Enhancing Java memory management: java.lang.OutOfMemoryError
| Article:TECH108440 | | | Created: 2002-01-12 | | | Updated: 2007-01-19 | | | Article URL http://www.symantec.com/docs/TECH108440 |
Problem
The database server (Java.exe) memory usage increases up to about 80 MB, and the server slows down considerably. Command Center slows down when executing group operations or the DesktopAgent Support service does not react as expected.
The CCM Desktop Agent Support Service or the CCM Database service logs:
2002-10-30 14:43:03 [10960:45FC] L1 [3015]: JDBGetComputer: Java error occurred attempting to find computer "rdskd03v":
com.on.ccm.dbserver.api.CcmCommException: Error occurred in server thread;
nested exception is:
java.lang.OutOfMemoryError
Or: Error unmarshaling return header ... java.io.EOFException
Solution
- Increase the maximum heap size of the JVM, which defaults to 64 MB. You may fine tune three separate instances of a CCM server.
- Open a DOS shell on the CCM server.
- Type the following:
cd /d %SME_ROOT%\services\ccmdb
- Stop the database service by typing one of the following:
net stop ccmdb
or
ccm stop
- Type the following:
ccmdb -s unbind
This creates Ccmshell.exe and Ccmdb.ini. - In Ccmdb.ini, add the -Xmx command-line flag, which sets the maximum heap size.
For example, to set the maximum heap size to 200 MB, type the following in the [application] section:
[application]
ExecPath=%SME_ROOT%\java\jre1.3\bin\java -Xmx200M -Xrs -cp %DB_CLASSPATH% com.on.ccm.dbserver.DbServer
- Type the following:
ccmshell -f ccmdb.ini -s bind ccmdb.exe
- Start the database service and its dependent services by typing the following:
ccm start
- Watch the Java.exe memory.
In case of high load, it should now exceed 80 MB, if required. - Open a DOS shell on the CCM server.
- Type the following:
cd /d %SME_ROOT%\services\rmiregistry
- Stop the RMI service by typing one of the following:
net stop ccmrmi
or
ccm stop
- Type the following:
ccmrmi -s unbind
This creates Ccmshell.exe and Ccmrmi.ini. - In Ccmrmi.ini, add the -Xmx command line flag, which sets the maximum heap size.
For example, to set the maximum heap size to 200 MB, type the following in the [application] section:
[application]
ExecPath=%SME_ROOT%\java\jre1.3\bin\java -Xmx200M -Xrs -cp %DB_CLASSPATH% com.on.ccm.dbserver.DbServer
- Type the following:
ccmshell -f ccmrmi.ini -s bind ccmrmi.exe
- Start the database service and its dependent services by typing the following:
ccm start
- Watch the Java.exe memory.
In case of high load it, should now exceed 80 MB, if required. - Stop the CCM services.
- Load %SME_ROOT%\dbin\jdbapi.jpf into any text editor.
- Browse to theMaxHeap section.
- Set MaxHeapMB=200
- Delete the hash sign (#) at the start of the line.
- Start the services.
To fine-tune the CCM database server
To fine-tune the RMI server
To fine-tune the Desktop Agent Support service
General recommendations
The performance of the CCM server can be optimized in combination with the following hardware recommendations: For each 1000 clients, allow approximately 512 MB of RAM and one CPU.
Technical Information
Fine tuning Java Memory management is a delicate issue. Because Java memory allocation is different from C++ programs, Java does not allocate memory at run time for each individual thread, but for the JVM in general. Also Java does not unregister allocated memory space automatically when the thread closes. Unused Java memory is periodically cleared by a separate clean-up thread called the garbage collector.
The default Java memory settings are 64 MB, which might be inappropriate in a larger environment, in which the garbage collector may run on a permanent basis. An indicator would be high CPU activity over a long period of time.
Do not set the heap size to high because that will prevent the garbage collector from properly cleaning up the JVM memory.
|
|
Legacy ID
2002111203434960
Article URL http://www.symantec.com/docs/TECH108440
Terms of use for this information are found in Legal Notices









Thank you.