users@glassfish.java.net

Re: Glassfish kills business

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Tue, 23 Aug 2011 08:44:35 -0500

As a quick experiment, I put several ISO files in the docroot directory
of a fresh install of GlassFish. Each of the files was about 700MB.
Then I started jvisualvm on the GlassFish process and watched what
happened to the memory as the files were downloaded. First I downloaded
one file at a time, and then I started 3 downloads at once. Here's the
graph:




The initial live object heap was about 22MB with a heap size of 48MB.
When the first downloaded started, the heap size jumped to 78 MB. The
2nd download of the same file made the heap size jump to 512MB (this is
the maximum size for the process) and note that the live object size
went up too. The 3rd download triggered a garbage collection (the blue
line), but then the live object size went right back up. The next
downloads were for a different file, and the live object size dropped to
about 150 MB. Towards the end of the graph at about 8:28am, is where I
tried 3 downloads at once. Notice that there are several GC's here. At
the end, right at 8:30, I clicked the Perform GC button, and this made
the life object heap go back to the original value of about 22 MB.

In summary, downloading static files through GlassFish can consume large
amounts of memory if it is available. I did not see any "out of memory"
errors in the log though.

It might be useful to run jvisualvm on your system to see what sort of
memory profile you have.

Tom