memory leak in libjava runtime/minGW, or failure to collect garbage?

Erik Poupaert erik.poupaert@chello.be
Fri Mar 21 19:23:00 GMT 2003


The system administrator notified me that the windows NT4.0 server on which
my xmlrpc servant process was running, had crashed after exhausting its
machine memory. I've investigated the issue with a test client.

The servant contains only Java code: org.apache.xmlrpc, com.mysql.jdbc, and
some code I've written in Java. I believe org.apache.xmlrpc creates one
thread for each request. All memory usage should be transient, since nothing
gets cached. After processing such request, the request-specific objects are
released. The test client serializes all its requests, so memory usage could
not be attributed to concurrent threads creating objects.

The minGW version of the application has been compiled with gcj (GCC) 3.3
20030218 (prerelease). The linux version has been compiled with gcj (GCC)
3.3 20030306 (prerelease).

On win32 the process starts with a reported memory usage 3 to 4 Mb (task
manager). After 30 minutes of stress testing, the process already consumes
well in excess of 60 Mb, without any indication that its memory consumption
is stabilizing. On linux, the process starts with a reported memory usage of
8.2 Mb (Gnome detailed system monitor). Memory consumption grows much
slowlier (at slowing growth rate) but I cannot ascertain that it reaches a
maximum eventually.

I really would like to prevent the situation in which the kernel starts a
victim-selection procedure and randomly shut down processes to prevent the
system from dying.  Does anybody know why memory consumption continues to
grow? Is there any guarantee that memory will be reclaimed before causing a
system-wide failure?



More information about the Java mailing list