I write a simple program and use jconsole.exe to monitor its heap size.
public class HeapTest { public static void main(String[] args) { while(true)
you've assumed that main( ) is your only thread, which is an incorrect assumption. There are other threads that will allocate objects