PermGen space error

Document created by justin_petrone Employee on Jul 20, 2015Last modified by vreddy on Mar 1, 2016
Version 2Show Document
  • View in full screen mode
How to Correct A java.lang.OutOfMemoryError: PermGen space Error

PermGen space is Java’s fixed block of memory for loading class files and it is most likely getting exceeded.

 

Use the following steps to increase the atom's memory:
  1. Stop the atom or molecule.
  2. Navigate to <atom_or_molecule_installation_directory>\bin.
  3. Open the atom.vmoptions file a text editor such as Notepad.
  4. Change -Xmx512m to -Xmx1024m.

0EM40000000PIdl

  1. Save the file and restart the atom or molecule
While increasing the heap memory will help, you may want to also consider explicitly increasing the "permgen" space as well.

Stop the atom and edit the atom.vmoptions file (that can be found in the atoms bin folder) and add the following line to the end of the file:

-XX:MaxPermSize=128m

Save the file and then restart the atom.

Monitor it for some time.  If problems persist, you may need to increase this value again, for example:

-XX:MaxPermSize=256m

Keep in mind though that the standard Garbage Collection (GC) behavior in java is generally to use what is allowed. So if you allocate 768MB to the PermGen space, then the JVM won't invoke its Garbage Collection until there is a need to do so. In an active JVM, you may see a "full" PermGen space regardless of how much space you give it.

Other options include:
  • identifying the processes that are experiencing this error and optimizing the process design
  • batching the inbound data in smaller amounts
  • spreading out process schedules so only one high memory process is executing at a time
  • reducing the frequency the high memory process is executing
  • adding atoms to execute high memory processes
  • upgrading to a molecule
  • adding nodes to an existing molecule
JAVA 8 : From Java 8 the "java.lang.OutOfMemoryError: PermGen space" error will no longer exist but now its a regular out of memory error. The JVM flags PermSize and MaxPermSize are now ignored.

 

You can add this property in the atom_install_dir\bin\atom.vmoptions
-XX:MaxMetaspaceSize=<metaspace size>[g|m|k]

 

eg. -XX:MaxMetaspaceSize=1024m

 

 

Attachments

    Outcomes