3

my application is running on:

  • apache-tomcat-7.0.27;
  • primefaces 3.1.1;
  • mysql-connector-java-5.0.8;
  • jsf 2.0;
  • c3p0-0.9.2-pre2;
  • hibernate3;

and after a few minutes before starting server and visiting a few pages I got this:

Exception in thread "C3P0PooledConnectionPoolManager-Helper Thread-#0" java.lang.OutOfMemoryError: PermGen space

It's strange because I do not "stress" my system and I do only simple accesses.

I imagine this is a c3p0 issue or I'm missing something.

Anyway, this is my c3p0 configuration (*):

  • HibernateConnectionProviderClass = "org.hibernate.connection.C3P0ConnectionProvider";
  • HibernateC3p0MinSize = "3"
  • HibernateC3p0MaxSize = "5"
  • HibernateC3p0Timeout = "1800"
  • HibernateC3p0IdleTestPeriod = "100"

(*) Ignore the configuration format because it's in a class and runs in execution time.

pb2q
  • 58,613
  • 19
  • 146
  • 147
Adriano Castro
  • 1,411
  • 4
  • 19
  • 33
  • 1
    I'm not sure that `C3P0` is the culprit. Memory leaks can happen in a lot of places. You should try to trace the problem back to it's root. This link explains a few things about `PermGen`problems and how to analyze them. The example is even for `Tomcat`. http://cdivilly.wordpress.com/2012/04/23/permgen-memory-leak/ – Sebastian_H Sep 24 '12 at 14:05
  • its a good ol' c3p0/cglib leak: duplicate here: http://stackoverflow.com/questions/5418318/hibernate-outofmemoryerror-permgen-space – guido Sep 24 '12 at 14:05

1 Answers1

-1

I would try adding -XX:MaxPermSize=256m to the JAVA_OPTS variable in setenv.sh or setenv.bat on windows. This file is in the bin folder inside your tomcat's installation directory.

Boiler Bill
  • 1,900
  • 1
  • 22
  • 32