Jboss Error Stderr Java.lang.outofmemoryerror Permgen Space
Contents |
here for a quick overview java.lang.outofmemoryerror permgen space jboss 6 of the site Help Center Detailed answers to any
Java.lang.outofmemoryerror Permgen Space Jboss 7
questions you might have Meta Discuss the workings and policies of this site
Java.lang.outofmemoryerror Permgen Space Jboss 4
About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack
Permgen Space Jboss Settings
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Jboss 4.2.1 GA java.lang.OutOfMemoryError: increase permgen space jboss 7 PermGen space up vote 0 down vote favorite I am using Jboss 4.2.1 GA in my windows7 system. When I run my application I am getting the following error. 2015-03-10 10:33:22,413 ERROR [STDERR] Exception in thread "Thread-30" 2015-03-10 10:33:23,061 ERROR [STDERR] java.lang.OutOfMemoryError: PermGen space 2015-03-10 10:33:23,061 ERROR [STDERR] Exception in thread "Initialize" 2015-03-10 10:33:23,061 DEBUG [org.jboss.cache.interceptors.TxInterceptor] Running rollback phase 2015-03-10 10:33:23,061 ERROR [STDERR] java.lang.OutOfMemoryError: PermGen space 2015-03-10 10:33:23,061 DEBUG [org.jboss.cache.interceptors.TxInterceptor] Finished local commit/rollback method for GlobalTransaction:
message "PermGen space"), it simply means the JVM ran out of memory. When it occurs, you basically have 2 options: Solution 1. Allow the JVM to use more memory With the -Xmx JVM argument, you can set the heap size. For instance, you can allow the JVM to use 2 GB (2048 MB) of memory with the following command: Configuring java heap size Shell $ java -Xmx2048m ... 123 $ java -Xmx2048m ... Solution 2. Improve or fix the application to reduce memory usage In many cases, like in the case of a memory leak, that second option is the only good solution. A memory leak happens when the application creates more and more objects and never releases them. The garbage collector cannot collect those objects and the application will eventually run out of memory. At this point, the JVM will throw an OOM (OutOfMemoryError). A memory leak can be very latent. For instance, the application might behave flawlessly during development and QA. However, it suddenly throws a OOM after several days in production at customer site. To solve that issue, you first need to find the root cause of it. The root cause can be very hard to find in development if the problem cannot be reproduced. Follow those steps to find the root cause of the OOM: Step 1. Generate a heap dump on OutOfMemoryError Start the application with the VM argument -XX:+HeapDumpOnOutOfMemoryError. This will tell the JVM to produce a heap dump when a OOM occurs: Trigger heap dump on OOM Shell $ java -XX:+HeapDumpOnOutOfMemoryError ... 123 $ java -XX:+HeapDumpOnOutOfMemoryError ... Step 2. Reproduce the problem Well, if you cannot reproduce the problem in dev, you may have to use the production environment. When you reproduce the problem and the application throws an OOM, it will generate a heap dump file. Step 3. Investigate the issue using the heap dump file Use VisualVM to read the heap dump file and diagnose the issue. VisualVM is a program located in JDK_HOME/bin/jvisualvm. The heap dump file has all information about the memory usage of the application. It allows you to navigate the heap and see which objects use the most memory and what references prevent the garbage collector from reclaiming the memory. Here is a screenshot of VisualVM with a heap dump loaded: This will give you very strong hints and you will (hopefully) be able to find the root cause of the problem. The problem could be a cache that grows indefinitely, a list that keeps collecting business-speci