[olug] Commanding java_vm to give memory back to the OS?

Rob Townley rob.townley at gmail.com
Wed Jan 25 17:11:21 UTC 2006


   According to the "KDE System Guard" process list, my java_vm is
using 276MegaBytes of memory.  I only have 256MB of physical ram, so
my harddrive is swapping like crazy and wasting battery life.  I
opened the java console and ran garbage collection, but the console
says java is using less than 4MB of RAM.   I know for certain, that
there are no Java applets running, so it should be using zero.  How
can i command JAVA to give the memory back to the operating system
that it is not using?

  At one time, there was NOT a standard C function to actually tell
the C runtime to give the memory back to the OS.  The C runtime would
keep the memory even though you had freed it.  But some operating
systems have a  non standard call to free the memory.

256MB RAM
Java 1.5
FireFox 1.5
Debian Linux with 2.6 Kernel



More information about the OLUG mailing list