[kaffe] Garbage Collection Questions

Rafael Teixeira monoman at gmail.com
Wed Aug 2 10:40:14 PDT 2006

An alternative, is to use a subprocess (shell), to do the large work
and quit afterwards. So your app becomes a wrapping manager that
spawns the subprocess only when needed.

The startup time will be a bit larger, but you can return all the
memory to the OS.

Just to give some option that works for any VM.


On 8/2/06, Michael Franz <mvfranz at gmail.com> wrote:
> Hi,
> I have gotten my answers on IRC, but thought I would also ask here.  Some
> background on my problem.
> I have a need for a Java application to load a large amount of data.  Larger
> than is normal, I can load it into the JVM my using the correct -Xmx values.
>  The issues is that after I have loaded the data and performed whatever
> logic I need to I want to discard the memory that was used.  The JVM will
> garbage collect the objects, but the JVM has allocated the largest amount of
> memory it could from the OS.  What I want to occur is to have the JVM
> (eventually) release this memory back to the OS.  It would not have to be
> immediate, but it should be release within a reasonable amount of time.
> From my research Sun's implementation does not ever release memory back to
> the OS.  I guess for server side processes this is ok, but for a desktop
> application that needs to play well with other applications (not all Java)
> it is not ideal.
> The garbage collector can release the memory.  What kind of algorithms would
> be good candidates for determining when and how much should be released?
> Has anyone done and research on this topic?  Or actually implemented this
> type of functionality in a branched version of Kaffe?  Is there any JVM that
> currently does this?
> Michael
> _______________________________________________
> kaffe mailing list
> kaffe at kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Rafael "Monoman" Teixeira
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man." George Bernard Shaw

More information about the kaffe mailing list