0

I am developing an application using java and I am using GlassFish Serve 3+ as my container, some times when I run my application run into the following error, I am wondering what would be the reason,

type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: PWC1243: Filter execution threw an exception
root cause

java.lang.OutOfMemoryError: PermGen space
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2.2 logs.
Daniel Morgan
  • 782
  • 5
  • 15
  • 43
  • Have a look at this [link](http://stackoverflow.com/questions/7683434/permgen-space-error-glassfish-server) .Somebody has asked a similar question. – aksappy Feb 19 '13 at 05:32
  • It won't help with a memory leak - but it may be interesting to note that Java 8 has done away with Perm Gen. – Fortyrunner Apr 28 '14 at 04:18

3 Answers3

0

java.lang.OutOfMemoryError

Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector. OutOfMemoryError objects may be constructed by the virtual machine as if suppression were disabled and/or the stack trace was not writable.

Check if you are creating too many objects using the new keyword. Locations to look for are loops, recursive methods among others.

0

Set the PermSize in JAVA_OPTS environment variable [used to allocate memory to Java JVM] If it is already set, increase the MaxPermSize

eg:

JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx1024m -XX:MaxPermSize=1024m -XX:PermSize=128m"

More detailed info about JAVA_OPTS is here

http://www.unidata.ucar.edu/projects/THREDDS/tech/tds4.3/reference/JavaOptsSummary.html

RahulArackal
  • 944
  • 12
  • 28
0

I know in NetBeans' default glassfish configuration, it doesn't tell the server to clean up its unused classes. Try the following solution:

Glassfish PermGen out of Memory Errors