users@glassfish.java.net

Re: Glassfish using too much memory

From: Chris Donaldson <Christopher.Donaldson_at_Sun.COM>
Date: Tue, 19 Aug 2008 15:22:49 -0500

Hi Felipe,

That is not unusual usage. Your total memory usage is basically going
to equal JVM/Native/thread space + Java Heap + Java Perm Gen.
Calculating the first one is difficult, but it is generally going to be
at least a couple hundred MB. The second is determined by -Xms (start
value) and -Xmx (max value). The final value is determined by
-XX:PermSize (start) and -XX:MaxPermSize (max). You want to take
individual care not to run out of native space, heap space (in any of
the generations), or perm space, all while staying under process limits
(~4GB for 32 bit Solaris processes) and definitely not swapping (KILLS
performance).

Permanent Generation holds all of your classes and methods. In a dev
environment, this could potentially get very large. If you are getting
PermGen errors, try increasing your MaxPermSize (try 128m).

More info can be found here:

http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
http://docs.sun.com/app/docs/doc/819-3681/abeia?a=view

Regards,
Chris




Felipe Jaekel said the following on 08/19/08 15:00:
> I have Glassfish V2 UR1 installed in a Ubuntu 8.04 server. It consumes
> about 700MB of memory. Is it normal?
>
> In my developing environment memory usage increases so much that I get
> PermGen space error.
>
> Thanks for any help,
> Felipe