Crispin Miller <[EMAIL PROTECTED]> writes:

> I posted to the group recently with a very similar problem to Luigi's problem -
> I think there is a memory leak in StringBuffer somewhere: the following code
> slowly eats up memory (it doesn't on a Sun).
> 
> (running on JDK1.2-pre1).
> 
> import java.util.*;
> 
> public class SBTest {
>     public SBTest() {
>        int i = 0;
>        while(true) {
>          System.out.println(i + " ");
>            i++;
>            System.out.flush();
>            System.gc();
>        }
>     }

A thight loop (without sleep or yield), like the one above, will not
let the gc thread in on the party. That's the case if you run on a
preemptive JVM (i.e. with green threads) with real time slicing
(native threads) it'll work.

-- 
Jan-Henrik Haukeland


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to