Jan-Henrik Haukeland wrote:
...A closed loop like this one will not let the gc thread in to do its
work. Try to run the program in its own thread or issue a yield() or
sleep() in the loop. ...
thanks for the advice, I'm afraid it still grows in size - even with all three
suggestions...
-----------------------
import java.util.*;
import java.lang.Thread;
public class SBTest extends Thread {
public SBTest() {
}
public void run() {
int i = 0;
while(true) {
System.out.println(i + " ");
i++;
System.out.flush();
System.gc();
yield();
try {
Thread.sleep(10);
}
catch(InterruptedException e) {
System.out.println("Boo!");
}
}
}
public static void main(String[] args) {
SBTest m = new SBTest();
m.start();
}
}
----------------------
Is this what you meant, or am I being dumb?
Crispin
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]