Search code examples
javaglassfish-3

Why am I receiving java.lang.OutOfMemoryError: PermGen space error?>


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.

Solution

  • 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.