Secure Programming
RE: secure storage of sensitive data in J2EE Feb 09 2005 11:16PM
Michael Silk (michaelsilk gmail com)
Hi Randy,

> I've always wondered what the point of a System.gc() was...
> what applications would calling System.gc() be useful if the
> JVM has the right to choose wether or not it gets called?

It's _hinting_ to the system that it might be appropriate to run gc
now. As for under what circumstances it might take notice, the java
documentation might help you more.

A useful scenario is if you are about to allocate a large amount of
memory, and you'd like to free up space from objects you declared
earlier (and out of scope).

> Does anyone know of an actual useful implementation of System.gc()?

Do you ever run out of memory in your java programs? (and it's not
your fault?) Then Sun's implementation is useful :)

-- Michael

[ reply ]


 

Privacy Statement
Copyright 2010, SecurityFocus