putting runtime.gc() and runtime.runFinalization() before the calls to totalMemory() and freeMemory() seem to stabilize it at 4.

Does that seem like a reasonable solution?

Yes.

I was thinking of suggesting a gc() call, so I'm pleased to hear
that it appears to improve the result.

thanks,

bryan

Reply via email to