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.runFinalization() or System.gc()

807597Sep 26 2005 — edited Sep 27 2005
Hello, after my program finishes certain tasks, that involve creation of very large objects, and destruction of previous ones, i have to call System.gc() to clean up, otherwise i eventually get an "out of memory" error from windows. Should i call System.runFinalization() before System.gc() to make shure the finalizers of my objects are called? or does calling System.gc() does this automatically? if it does, then why have the System.runFinalization() at all?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2005
Added on Sep 26 2005
33 comments
938 views