0

(Not a duplicate, i've searched everywhere) I am using Ubuntu server and Tomcat7 gave a PemGenError out of memory. Then i increased the memory in setenv.sh file using export CATALINA_OPTS="Xms2048M -Xmx2048M". Error disappeared for awhile. But now its appearing again.

  1. I am using Tomcat for OpenMRS.
  2. Pretty sure it doesn't take that much memory.
  3. I am running OpenMRS in my laptop fine without allocating this much memory.

Any solution to this?

Nipun Thathsara
  • 1,119
  • 11
  • 20
  • Not a duplication since every question is about initial error of out of memory. This happens even after increasing the memory more than enough. I think the increasing worked because the tomcat ran fine for awhile afterwards. – Nipun Thathsara Jul 07 '16 at 06:50

2 Answers2

1

You have increased the wrong memory pool. When tomcat is out of PermGen-memory increasing the heap won't help. Try -XX:MaxPermSize=128m (default is 64m).

As an alternative think about migrating to Java 8 that does not have the PermGen at all. Instead there's metaspace that (in the default settings) would grow indefinitely as long as your machines memory allows.

piet.t
  • 11,718
  • 21
  • 43
  • 52
  • Thank you, now only i understood what happened when i added JAVA_OPTS with above mentioned parameters instead of CATALINA_OPTS with heap. – Nipun Thathsara Jul 07 '16 at 08:23
0

Set the minimum to 1024M and restart tomcat!

nioidai
  • 41
  • 4