Odi,

This is a curiosity, I agree.

I take this documentation from System.gc() at face value:
"When control returns from the method call, the Java Virtual Machine *has* made a best effort to reclaim space from all discarded objects." (emphasis added) - In other words, it is blocking, although "best effort" is not exactly well defined.... I've not really looked on the web, though, to see whether the actual implementation varies.


In my original patch, I found that the sleep was necessary in order to let the thread that was not being garbage collected actually finish processing; otherwise it would not be collected by the gc() call. Since Mike's new approach no longer uses multiple threads, the sleep prior to the gc() call is unnecessary now.

-Eric.

Ortwin Glück wrote:

Mike,

in the test case I would rather introduce a Thread.sleep AFTER the System.gc() call as well to give the GC time to run. GC happens asynchronously. The System.gc() call is not blocking!

Odi

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24309


------- Additional Comments From [EMAIL PROTECTED] 2003-11-12 00:27 -------
Any more thoughts on this one, or should I apply?


Mike



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to