Error: "java.lang.OutOfMemoryError"
This document (3173888) is provided subject to the disclaimer at the end of this document.
Environment
Novell exteNd Director 4.1 Standard Edition
Novell iManager 2.01
Novell eGuide 2.1.x
NetWare 6.0
OES on NetWare 6.5
Tomcat 3.3
Tomcat 4.1.18
Apache 1.3.33 for NetWare
Apache 2.0.52
Situation
Getting out of memory errors when using Novell Portal Services 1.5, exteNd Director 4.1 Standard, or iManager 2.01 on NetWare 6.0.
Portal starts running slow and does not allow new users to log in when exceeding approximately 480xxxxxx of Total Committed JVM Memory
Restarting Tomcat temporarily resolves the problem (until memory reaches capacity again)
Resolution
Procedure
(1) Depending on which version of Tomcat you are running, open your TOMCAT33.NCF or TOMCAT4.NCF file found in the SYS:/TOMCAT/33/BIN or SYS:/TOMCAT/4/BIN directory. Here you will need to add two parameters to the file. One for the minimum heap size and one for the max heap size. The parameters are as follows:
-Xms128m -Xmx256m
(2) Insert these parameters into the TOMCAT33.NCF or TOMCAT4.NCF file. At the bottom of the file you will find a line similar to the following:
java -envCWD=$TOMCAT_HOME -classpath $TOMCAT_CLASSPATH -Dtomcat.home=SYS:\tomcat\33 org.apache.tomcat.startup.Main -f sys:/tomcat/33/conf/nwserver.xml %1
(3) Add the heap size parameters to the this line, right after the"java" directive. The new line will look as follows.
java -Xms128m -Xmx256m -envCWD=$TOMCAT_HOME -classpath $TOMCAT_CLASSPATH -Dtomcat.home=SYS:\tomcat\33 org.apache.tomcat.startup.Main -f sys:/tomcat/33/conf/nwserver.xml %1
** IMPORTANT ** Each java process is allocated 512 meg of user space within the RAM that it can use. Some of that is used for java threads, socket communication, etc. So what is really available is not much more than 400 meg which can be allocated to a java process. This information can be seen at the server by typing in the command JAVA -SHOW and then finding out what the ID is for the Tomcat java process. Then at the server console you can type JAVA -SHOWMEMORY# with the # representing the Tomcat process ID. Then switch over to the logger screen and you should see how much memory is being allocated within the Tomcat process. An example is shown below:
JAVA -SHOW
Classname ID
========================================== =========
org.apache.tomcat.startup.main..................................... 390
JAVA -SHOWMEMORY390
Memory Statistics For Class: org.apache.tomcat.startup.Main
-------------------------------------------------------------------------------------------
Reserved Heap: 68161536
Committed Heap: 11124732
Reserved Virtual Memory Pool: 67108864
Committed Virtual Memory Pool: 11272192
NLM Data Memory: 225280
Per Thread Data And OS Stacks: 3403776
Virtual Memory Pool Overflow: 0
JVM Tracking Memory: 23381
Socket Communication Memory: 101616
-------------------------------------------------------------------------------------------
Total Committed Virtual Memory: 22622204
Total Physical Memory: 3528773
Total Committed JVM Memory: 26150977
** NOTE ** The main statistics to look at here are the reserved heap and the committed heap. The reserved heap represents our -Xmx switch. This is the maximum memory that is allocated to the individual java process. What we show here by default is 68161536 which equates to 65 meg. The committed heap represents the -Xms switch. This is the minimum amount of memory that will be committed to the individual java process. In this instance we have 11124732 which equated to 8 meg of committed memory.
(4) To verify that our switches have changed our committed and reserved heap sizes we will need to take down java and then restart tomcat. See example below:
JAVA -EXIT
** IMPORTANT ** If the console comes back with MODULE JAVA.NLM UNLOADED, then you can startup tomcat by typing in TOMCAT33 or TOMCAT4 at the console prompt. If a message is immediately returning indicating "cleaning up JAVA resources in the background", and you have a console prompt, then you can type in JAVA -EXIT again to force java down.
(5) Once tomcat is started again you can check the memory again and it should now show up.
Memory Statistics For Class: org.apache.tomcat.startup.Main
-----------------------------------------------------------------------------------------------
Reserved Heap: 272633856
Committed Heap: 136314876
** TROUBLESHOOTING ** If you do not show the new memory size then one of the following probably happened.
(A) You reloaded Tomcat before JAVA was completely unloaded.
(B) You specified a maximum heap (-Xmx) that was too large. The most that this can be is around -Xmx386m without addition configuration.
(C) Your -Xms parameter is larger than your -Xmx parameter..
If this does not resolve the memory issues for your application, proceed with the following procedure:
(6) Edit the AUTOEXEC.BAT file found at the root of the C:\ drive. It should look similar to the example below:
C:
** NOTE ** In this example we are specifying 1 GIG of RAM to be used. The parameter is measured in bytes. This will get past the limit specified in step (4). You should now be able to increase your heap size above 400 MEG.
Additional Information
Another example of how the server -U switch was used to resolve the symptoms described above:
** NOTE ** One thing to be aware of is that if you do a RESTART SERVER command from the console, the -U setting does not hold with the kernel. You must use the RESET SERVER command in order to keep the -U option.
Formerly known as TID# 10070512

+ Upgrading to Open Enterprise Server 2 SP1 Linux
+ Open Enterprise Server 2 SP1 Migration Strategies
Disclaimer
This Support Knowledgebase provides a valuable tool for NetIQ/Novell/SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:3173888
- Creation Date:10-OCT-07
- Modified Date:27-APR-12
- NovelleGuideNetWareOpen Enterprise Server
- NetIQiManager
Did this document solve your problem? Provide Feedback
