Thursday, April 12, 2007

Should one pool objects to help GC? Should one call System.gc() periodically?

The answer is No!

Pooling objects will cause them to live longer than necessary. The garbage collection methods will be much more efficient if you let it do the memory management. The strong advice is taking out object pools.

Don't call System.gc(), HotSpot will make the determination of when its appropriate and will generally do a much better job.

0 comments :

 

Disclaimer
Interview Questions On Java,Java EE Copyright © 2016. Reads: best tracker