Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

System.gc() Versus Runtime.getRunTime().gc

807598Mar 1 2006 — edited Sep 26 2008
Hi Guys,

Which one is better System.gc or Runtime.getRuntime().gc()

Because currently i am encounter out of memory Exception because i process a very large dataset..

I test System.gc() on my system and it seems doesnt free up the memory while the Runtime.getRuntime().gc will free up the memory..

I M just wondering why a lot of articles tell to use System.gc()


Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2008
Added on Mar 1 2006
39 comments
991 views