0

i am working with liferay portal ,when deploying portlet on running server that returns

java.lang.OutOfMemoryError: PermGen space

this error coming not regularly,liferay running on tomcat, how can i solve this particular ??problem.

I tried adding JAVA_OPTS with the value as -Xms128m -Xmx256m in System Variables, still I am getting the same error (java.lang.OutOfMemoryError: PermGen space) again and again. Any help will be appreciated. I have also read other post in stackoverflow also but it didn't worked out.

Midnik47
  • 141
  • 3
  • 10
  • increase `-XX:MaxPermSize` – Subhrajyoti Majumder Aug 11 '14 at 12:14
  • All the answers so far are correct - you'll need to increment the PermGen Space. However, setting -Xmx256m sounds like ridiculously low - you'll most likely need to increase this next. Code and static blocks end up in PermGen, thus more plugins require more permgen space. You'll typically set this in tomcat's setenv.bat or setenv.sh in CATALINA_OPTS. To learn more, see the "Related" questions and answers on the right of this page - there's a lot of information already available about exactly this issue – Olaf Kock Aug 11 '14 at 14:28
  • @olaf Kock thank u ... now i increased PermGen space – Midnik47 Aug 12 '14 at 05:36
  • possible duplicate of [Dealing with "java.lang.OutOfMemoryError: PermGen space" error](http://stackoverflow.com/questions/88235/dealing-with-java-lang-outofmemoryerror-permgen-space-error) – Raedwald Aug 13 '14 at 11:58

4 Answers4

3

Expecially since Liferay 6.2 it's important to increase the default Perm size from 256mb to 512 mb. 256mb today is not enough to support the Liferay and some plugins.

-XX:MaxPermSize=512m

Daniele Baggio
  • 2,157
  • 1
  • 14
  • 21
2

-Xms1024m -Xmx1024m are heap size configuration not PermGen.

-Xms1024m is minimum heap size and -Xmx1024m maximum heap size.

You have to use

-XX:MaxPermSize=256m // now it is 256MB you can increase it

to configure PermGen

Edit:

I am adding this part to address your comment.

What is PermGen?

The permanent generation is special because it holds meta-data describing user classes (classes that are not part of the Java language). Examples of such meta-data are objects describing classes and methods and they are stored in the Permanent Generation. Applications with large code-base can quickly fill up this segment of the heap which will cause java.lang.OutOfMemoryError: PermGen no matter how high your -Xmx and how much memory you have on the machine.

Ruchira Gayan Ranaweera
  • 34,993
  • 17
  • 75
  • 115
1

You need to increase the PermGen space in your tomcat.

Use the following Java option:

-XX:MaxPermSize=256m

Refer to this question for more details. It looks similar.

Community
  • 1
  • 1
Maas
  • 1,317
  • 9
  • 20
0

You should try to add following line in the Memory ARGS: field in Tomcat setting.

-XX:NewSize=700m -XX:MaxNewSize=700m -Xms1024m -Xmx2048m -XX:MaxPermSize=768m

You can see in the link.

Screenshot

DinushaNT
  • 1,137
  • 6
  • 17
Jyoti
  • 21
  • 4