tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: permgen space increases every day
Date Wed, 22 May 2013 14:26:35 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Facchoch,

On 5/21/13 12:23 PM, fachhoch wrote:
> Thanks for your replies, I  use spring , hibernate , wicket. For
> some of my objects I create proxy   using spring, hibernate
> creates proxies  and injection into wicket objects uses spring
> proxy. I also  use groovy   with spring  and most of my groovy
> beans are of scope prototype.
> 
> 
> 
> <lang:groovy  id="someId" 
> script-source="classpath:com/../..LeadAnlystReturnedAssignmentEmail.groovy"
>
> 
scope="prototype" />

I think it's memory profiler time. The good news is that you should be
able to do it all for free (i.e. no cash).

First, read about how to enable profiling directly in the JVM:
http://docs.oracle.com/javase/7/docs/technotes/samples/hprof.html

(Hint: you want the heap=dump or heap=all options)

Or, you can take a heap snapshot (probably easier) using jmap like this:

$ jmap -dump:live,format=b,file=heap-dump.hprof.bin [pid]

(Where [pid] is of course the process id of your JVM)

Once you have a .hprof file, you can either try to use HAT (which
while providing lots of useful information is not terribly intuitive)
or you can use Eclipse's Memory Analyzer Tool (which I've never used,
but I have heard that it is fantastic).

I personally use YourKit (full disclosure: YourKit gives free licenses
to ASF committers so I have a free license) which I find quite good.

> Whats the best way I can force tomcat to garbage collect  my
> permgen, I am running tomcat with -Xmx1024m -Xmx1024m
> -XX:MaxPermSize=1024m

Any full GC will clean PermGen as much as possible. Unless disabled,
calling System.gc() should request a full GC, but it's not guaranteed.
Enable GC logging to find out what is being collected and when.

I suspect that if you are seeing PermGen free-space shrink all the
time and full GCs are occurring (they do happen, though infrequently
as they are kind of time-consuming) then you are really just filling
it up with "useful" stuff.

The question is: how can you reduce it so used-PermGen doesn't grow
without bound.

You never answered my question: do you ever actually run out of
PermGen space, or are you just particularly worried about it happening?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRnNWaAAoJEBzwKT+lPKRY35wP/0saW8nRZBAkU0d1QyEwiZV4
sequ/mpkK9X4M0o+9Q+o9m71iM0mX1HT+juBs05mji2jmTFQQLvGaXRlUghJiXQy
3r00cPZ4ytfTGgo88JOfi2pfCf3g1S2WiyYT4eocqxwG8jDZ/9HuQYCnvK8dFk3K
eVP5vyQbdypzOwc80tfiRbd7jcSwGOnVgiEFvQ/dlKYxry6u0n+Q9hAh1DHmYrz0
vtIwB0dGU+yh1NtCAg90zwa3tlKum50AX4gfpeAS9TOsboAN+GY46r+maeH+Djih
RD6kj/zsZ7uIt8v3F0IvGwlzi+awsuilu6fTyNSJxOXObw5EM2Omv7NHLOLlKyvL
P3C8dd5+G0nE2A2PqcIDGq41CQaitMrmlgLTnynKx3AgB3fSmn3qKSe89pKUpvK/
gqNOGq+QO8HzQmFK4D504greO5SB+5NYqoB2k+Y5b/MVlCoknVxWF1M09yuvXtr8
ZFnASSoZzbhlex06k1OD9u/5SqWe9GdNH7fm289AlywydQfYYlmts9vXnwmyvtnO
Ue7jEpou9Znl+w1pHuzhmCN9h+WgT3APB/Bx1GvoJuTEeMlI/aUGcxBLXhLC348G
kaougOhJsoP+GVVFFljfJXoslGtfLvtvbTe670EqPRdg1y0L5jbe308wq9Z76jea
56B1Tb3gAKy0puZwHrBs
=bpRa
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message