I've got a Glassfish v3 server running a few web applications (servlets, JSP, JDBC). I'd been noticing that if I let Glassfish run for a long time, it will consume all of the memory available (this is running on a server with 750 MB of memory).
I figured that there must be a memory leak, so I ran the server while monitoring it with JProfiler and noticed that when I get a peak in traffic, my memory usage shoots up (as expected), but then quickly drops back down.
I'm wondering if the issue is less of a memory leak, and more that Glassfish expands its heap size when the spikes occur (this does seem to be happening) but never decreases the heap size when the actual memory usage declines.
However, based on this graph, it does seem like the memory usage (blue) is trending upwards as the server runs longer.
My question is two-fold:
Is there any way to have the heap size decreased when the actual memory usage drops after a spike?
Is it probable that I do have a memory leak, or is this normal? What can I do to investigate this memory usage further?