Request for Review: 7094995: test/java/util/zip/ZipFile/ causes continuous GC in agentvm mode

David Holmes david.holmes at
Wed Nov 23 05:57:55 UTC 2011

Hi Neil,

On 22/11/2011 9:51 PM, Neil Richards wrote:
> I've created a webrev [1] to address the problem reported in bug
> 7094995, where the ClearStaleZipFileInputStreams testcase leaves a
> lingering GC inducing thread running after the test ends (when run in
> agentvm mode), as spotted by Alan and mentioned in another conversation
> [2].
> It modifies the testcase so the main thread tells the GcInducingThread
> to shut down, and waits for it to do so (using Thread.join()) before
> exiting.

As per the discussion from Alan and Chris, I would code it so that 
interrupt terminates the thread:

    catch (InterruptedException ie) {

> I've also converted the testcase's use of ZipFile, ZipOutputStream&
> FileOutputStream to use ARM (for greater clarity).

I think proper use of ARM requires that this:

   66         try (ZipOutputStream zos =
   67                 new ZipOutputStream(new 
FileOutputStream(tempZipFile))) {

be written as:

    try (FileOutputStream fos = new FileOutputStream(tempZipFile);
         ZipOutputStream zos = new ZipOutputStream(fos)) {


> Please let me know your thoughts on this change,
> Thanks, Neil
> [1]
> [2]

More information about the core-libs-dev mailing list