struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Casey Forbes <cfor...@kensfoods.com>
Subject Re: [OT] OutOfMemoryError when I have plenty of heap
Date Fri, 26 Sep 2003 14:31:11 GMT
My OutOfMemoryError problem is fixed.
Thanks for all of your suggestions.

Kito's permanent generation suggestion was the answer.
(Thanks Kito!)  I was able to monitor the perm space
utilization with the following JVM flags:

-J-XX:+PrintGCTimeStamps
-J-XX:+PrintGCDetails
-J-Xloggc:[path to gc log]

When I found that the default max perm size of 64 MB
was too low I increased it to 128 MB with:

-J-XX:MaxPermSize=128m

This took care of my OutOfMemory errors.

I also found a very cool tool called "jvmstat" which
can monitor your VMs and record performance data
(such as the heap utilization) without slowing down
your apps. This only works with the 1.4.1 JVM...
http://developers.sun.com/dev/coolstuff/jvmstat

Casey



On Thu, 18 Sep 2003, Kito D. Mann said:

> Casey,
>
> No problem. Good luck, and let us know when you figure out what the problem
> is. I know how annoying these problems can be -- I was once at a company
> where this problem sneaked passed QA, and those were some stressful days :-).
>
> Kito D. Mann
> Author, JSF in Action
> JSF FAQ: http://www.jsfcentral.com
>
> At 03:50 PM 9/17/2003 -0400, Casey Forbes wrote:
> >Hi Kito,
> >
> >Thank you. This is worth looking at (plus the link looks
> >interesting).  I've got a lot of classes that from JSP compilation.
> >I also have lots and lots of sun.reflect.GeneratedMethodAccessorXXXX
> >classes (from Digester and PropertyUtils I guess) and lots of
> >_xsl._ caucho_0anonymous__xsl classes from Resin's XSLT
> >engine.
> >
> >I'm also looking at Daniel's suggestion about hitting
> >the open files limit (which I can easily increase if it
> >turns out to be the cause)
> >
> >Casey
> >
> >
> >
> >
> >On Wed, 17 Sep 2003, Kito D. Mann said:
> >
> > > Casey,
> > >
> > > If you're using JSP, and you have a large number of pages running in a
> > > single VM, you may be filling up the "permanent generation" area of the
> > > VM's memory. This is a fixed amount of memory dedicated to classes,
> > > methods, and so on (reflective data). Since JSPs are compiled into classes,
> > > it's actually possible to fill up this area of memory and consequently get
> > > an OutOfMemoryError. You can, of course, increase the size -- see
> > > http://java.sun.com/docs/hotspot/gc1.4.2/ for details.
> > >
> > > How many JSPs does At 08:21 AM 9/17/2003 -0400, you wrote:
> > > >Hi everyone,
> > > >
> > > >There are many smart people on this list and I haven't been
> > > >able to get anywhere with this problem, so...
> > > >
> > > >I'm running 12 Struts-based apps under Resin 2 on a Linux box.
> > > >(I don't believe that this is a Struts problem - this is
> > > >just some background for you)
> > > >
> > > >Every few days (sometimes this will happen after 2 days, sometimes
> > > >5 or 6) I get an OutOfMemory error which stops the JVM...
> > > >I have plenty of room in the heap (the machine has 1 GB or
> > > >RAM and I have the max heap size -Xmx set to 896 MB) Just before
> > > >it dies there are a few attempts to free more memory.
> > > > >From the GC log:
> > > >
> > > >Full GC 227765K->132728K(274140K), 3.2615930 secs
> > > >Full GC 132729K->132728K(274140K), 2.5218730 secs
> > > >Full GC 132803K->120231K(274140K), 3.1998370 secs
> > > >OutOfMemoryError
> > > >
> > > >As you can see - I'm only using 132 MB after the first
> > > >GC which leaves plenty.... Runtime.freeMemory()
> > > >etc. returns similar results..
> > > >
> > > >Does anybody have any ideas? I don't even know where to look
> > > >next... It doesn't look like a profiler would help me here
> > > >since I don't have tons of objects filling up my memory.....
> > > >
> > > >Thanks,
> > > >Casey
> > >
> > > Kito D. Mann
> > > Author, JSF in Action
> > > JSF FAQ: http://www.jsfcentral.com
> > >
> > >
> > >
> > >
> > >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message