-
1. Re: Problem with java.lang.OutOfMemoryError
erasmomarciano Sep 25, 2008 9:31 AM (in response to ridzuan_majid)Try , to set in run.conf the following variable
JAVA_OPTS="-Xms512m -Xmx512m" -
2. Re: Problem with java.lang.OutOfMemoryError
erasmomarciano Sep 25, 2008 9:31 AM (in response to ridzuan_majid)
Try , to set in run.conf the following variable
JAVA_OPTS="-Xms384m -Xmx384m" -
3. Re: Problem with java.lang.OutOfMemoryError
thetikigod Sep 25, 2008 3:07 PM (in response to ridzuan_majid)Periodically when developing and redeploying web apps, an error will occur and the JBoss AS will crash, burn, and will require a restart. Most of the time, the error is an out of memory error and will appear in the console as follows:
10:10:22,640 ERROR [MainDeployer] Could not create deployment: file:(yourFile) java.lang.OutOfMemoryError: PermGen space
To fix this you will need to modify the run file, again. There are two options: increase the size of the PermGen or allow garbage collection on PermGen . Each method has its pro/cons. Increasing the size of the PermGen will only delay the errors longer, because the memory will be used up eventually. If all you are looking to do is increase the time between restarts, this is a viable solution. If low memory is an issue or if the error must be prevented altogether, then garbage collection should be permitted on PermGen. With this solution, you may run the risk of garbage collecting classes that will be used again (this has not been tested). Both may be used which may lessen the risk that classes will be collected before their time. Realize that this does not eliminate the risk. Note that both methods will require JBoss AS to be restarted.
Increase Memory Size of PermGen:
1. Navigate to JBOSS_HOME/bin/.
2. Open the run.conf (run.bat for windows) file for editing.
3. Add the following after the remote debugging lines:
In run.conf:# Memory configuration to delay PermGen: OutOfMemoryError(s) JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=512m"
In run.bat:rem Memory configuration to delay PermGen: OutOfMemoryError(s) set JAVA_OPTS=-XX:MaxPermSize=512m %JAVA_OPTS%
4. Save the file.
5. PermGen will be configured with a larger memory space.
*Note: A size other than 512 may be used.
Garbage Collection on PermGen
1. Navigate to JBOSS_HOME/bin/.
2. Open the run.conf (run.bat for windows) file for editing.
3. Add the following after the remote debugging lines:
In run.conf:# Garbage Collection configuration to fix PermGen: OutOfMemoryError(s) JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled"
In run.bat:rem Garbage Collection configuration to fix PermGen: OutOfMemoryError(s) set JAVA_OPTS= -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled %JAVA_OPTS%
4. Save the file.
5. PermGen will be configured to be garbage collected. -
4. Re: Problem with java.lang.OutOfMemoryError
ridzuan_majid Oct 13, 2008 4:31 AM (in response to ridzuan_majid)I already try the both command to increase PermSize but I got this error :
Unrecognized option: -XX:MaxPermSize=512m
Could not create the Java virtual machine. -
5. Re: Problem with java.lang.OutOfMemoryError
peterj Oct 13, 2008 12:50 PM (in response to ridzuan_majid)What JVM are you using? My guess is it is not a Sun JVM.
-
6. Re: Problem with java.lang.OutOfMemoryError
ridzuan_majid Oct 14, 2008 9:50 PM (in response to ridzuan_majid)This is the version on Java that im using.
java version "1.3.1_06"
Java(TM) 2 Runtime Environment, Standard Edition (build SCO-UNIX-J2SE-1.3.1_06:*FCS*:20021212)
Classic VM (build SCO-UNIX-J2SE-1.3.1_06:*FCS*:20021212, native threads, sunwjit) -
7. Re: Problem with java.lang.OutOfMemoryError
peterj Oct 15, 2008 11:27 AM (in response to ridzuan_majid)Wow, that is ancient, and not from Sun. Though I suspect that SCO is (was?) a Sun licensee and simple recompiled the Sun JVM for use on their flavor of UNIX.
I tried my JDK 1.3.1_12, and it accepts the MaxPermGen option. Looks like SCO made some changes. You will have to ask SCO what to do about this. -
8. Re: Problem with java.lang.OutOfMemoryError
ridzuan_majid Oct 16, 2008 3:53 AM (in response to ridzuan_majid)Seems like that.. SCO make some changes.. Actually this system still running on SCO-UNIX, i need to upgrade but need to take a look at the original system when running on SCO