The Artima Developer Community
Sponsored Link

Legacy Design Forum
Finalization and Cleanup

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

wrefs

Posted by infotone on April 04, 2001 at 12:56 PM

> Correct me if I am wrong, but won't the WeakReferenced objects be reclaimed by GC only if it is running low on memory and do not have any other strong references?. You might want to start your command line program with

> java -Xmx1M <- restrict your VM to 1 MB memory.

No. You can force GC by invoking the static method gc() on the System object. eg:

System.gc();

This makes it easy to test wrefs.



Replies:
  • Weakrefs Thomas December 07, 2001 at 9:25 AM (0)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us