dev@glassfish.java.net

Re: appserv-tests and PermGen space

From: Scott Oaks <Scott.Oaks_at_Sun.COM>
Date: Thu, 21 Jul 2005 10:43:58 -0400

>
> ______________________________________________________________________
> From: Matthew L Daniel <mdaniel_at_scdi.com>
> To: dev_at_glassfish.dev.java.net
> Subject: Re: appserv-tests and PermGen space
> Date: Wed, 20 Jul 2005 10:46:30 -0400
>
> > in domain1/config to up the Xmx and XX:PermSize to no avail (or in some
> > cases it got much worse).
>
> Sorry to follow-up my own post, but I wanted to report back and ask an
> additional question.
>
> I finally achieved success by changing the Xmx512 to Xmx2g and adding
> PermSize=256m and MaxPermSize=2g, with the one addition that I missed
> before: changing "-client" to "-server".
>
> I have not yet done extensive testing to see where the break-even point
> is with the PermSize stuff, but wanted to ask about the "-server" flag.
> Is it reasonable to think the change from "client" to "server" matters?

Hi Daniel --

It is reasonable to change from client to server; it depends on how you
intend to use the appserver. The default settings (-client; -Xmx512m)
are designed for users who frequently start and stop the appserver.
Startup and memory footprint are much lower. However, after the server
has been started, it will start to run faster if you use -server, so if
you intend to keep it running for a while, then that's the better
choice.

I'm being vague when I say "a while" because it depends on your usage --
and your tolerance for startup. If you're developing, single requests to
the server might be 15-20% faster with -server, but still fast enough
with -client that you don't really notice (while you would notice the
startup time difference).

You certainly don't need 2G of perm space. I'm not sure that the perm
space was your problem. One way to tell is to use the jstat command
(part of JDK starting in 5.0); find out the process id of the appserver
and run:
jstat -gcpermcapacity PID

The PGC column will tell you how much perm space you're actually using.
If its under 64M, then the perm space setting isn't helping you at all,
and it may just be the heap setting that was originally causing you
problems.

-Scott