commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebastiano Vigna (JIRA)" <>
Subject [jira] Created: (IO-161) FileCleaningTrackerTestCase hangs
Date Tue, 01 Apr 2008 21:43:27 GMT
FileCleaningTrackerTestCase hangs

                 Key: IO-161
             Project: Commons IO
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 1.4
         Environment: Linux #1 SMP Wed Nov 21 15:12:59
EST 2007 i686 i686 i386 GNU/Linux
java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)

            Reporter: Sebastiano Vigna

The following code in FileCleaningTrackerTestCase never exits, hanging the whole compilation/testing

    private void waitUntilTrackCount() {
        while (theInstance.getTrackCount() != 0) {
            int total = 0;
            while (theInstance.getTrackCount() != 0) {
                byte[] b = new byte[1024 * 1024];
                b[0] = (byte) System.currentTimeMillis();
                total = total + b[0];

It is clear that in theory this code might loop forever, as the allocation of the byte arrays
might never unleash a garbage collection complete enough to deallocate all marker objects,
so to bring the track count to zero. Believe me, it's not only theory :).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message