Recently our application SM7.10.0123 died of Java heap errors. This started happening once in a week, with sm.log getting dumped with java heap errors, thereby killing system processes. Did some digging on this, came to knw it as an issue in sm7.10 which has been fixed in SM7.11 (release notes). Now I was trying with JVM options to control this occurrances.
I tried putting the parameters directly in sm.ini like below
We recently had the same issue with SM7.10. Servlets would crash every few days and we were restarting every few days as well. We upgraded the binaries only to 7.11 and it's been running stable for a week. It's a simple upgrade and very easy to rollback. I'd recommend upgrading to it to resolve this.
We tried everything to get 7.10 stable but nothing really helped.
I need help on this. I have applied the JVM options like below in our environment. But still I am finding JAVA heap errors which clearly tells me that, the min and max heap size which I have set is not in effect.
JRTE I Running Low On JavaHeapMemory PercentUsed: 80.0 Max:61997056 Used: 49598840
Below is how I have set the parameters in my sm.cfg
sm -JVMOption0:Xms384m -JVMOption1:Xmx512m -JVMOption2:Xrs -JVMOption3:XX:+HeapDumpOnOutOfMemoryError system.start
Today I was going thru one of the KB article 'KM725908' . The way in which it is mentioned in the article is how I have set in the sm.ini . But when I restart the sm service, i could see the errors like
create JVM failed. Shutting down sm application --(similar msgs)
Could you please guide me in how should i put this parameter correctly? For the JVMOption3:XX:+HeapDumpOnOutOfMemoryError
I could see the log file created of this in the RUN directory.
If I put the above parameters in the sm.ini not in sm.cfg, the JVM gets created successfully. But as I understand tat, if I use 256M as min and max, the garbage collection wont happen and unused memory wont get freed up.
If I amend the above same parameters, with Xms384m and Xmx512m in sm.ini, after the recycle, i get the below error in sm.log
5248( 5252) 11/19/2009 21:18:28 RTE E **** CreateJavaVM() failed! rc = -4 5248( 5252) 11/19/2009 21:18:28 RTE D -Xms384m 5248( 5252) 11/19/2009 21:18:28 RTE D -Xmx512m 5248( 5252) 11/19/2009 21:18:28 RTE D -Xrs 5248( 5252) 11/19/2009 21:18:28 RTE D -XX:+HeapDumpOnOutOfMemoryError 5248( 5252) 11/19/2009 21:18:28 RTE D -Djava.class.path=.\lib\common-7.10.jar;.\lib\commons-codec-1.3.jar;.\lib\commons-logging-1.1.jar;.\lib\embedded-7.10.jar;.\lib\FastInfoset-1.1.1.jar;.\lib\htmlparser-1.6.jar;.\lib\jgroups-all-2.5.0.jar;.\lib\k2.jar;.\lib\kmplugin-7.10.jar;.\lib\log4j-1.2.15.jar;.\lib\mail-1.4.jar;.\lib\saaj-api-2.1.jar;.\lib\saaj-impl-2.1.jar;.\lib\scautoserver-7.10.jar;.\lib\utility-7.10.jar;C:\Program Files\Common Files\Hewlett-Packard\HPOvLIC\lib\OvLic.jar 5248( 5252) 11/19/2009 21:18:28 RTE D -Djava.library.path=D:\Program Files\HP\Service Manager 7.10\Server\RUN 5248( 5252) 11/19/2009 21:18:28 RTE D -Djava.endorsed.dirs=.\lib\endorsed 5248( 5252) 11/19/2009 21:18:28 RTE D -Djavax.net.ssl.trustStore=D:\Program Files\HP\Service Manager 7.10\Server\RUN\jre\lib\security\cacerts 5248( 5252) 11/19/2009 21:18:28 RTE D -Djavax.net.ssl.trustStorePassword=changeit 5248( 5252) 11/19/2009 21:18:28 RTE D -Djavax.net.ssl.keyStore=D:\Program Files\HP\Service Manager 7.10\Server\RUN\smsrv.keystore 5248( 5252) 11/19/2009 21:18:28 RTE D -Djavax.net.ssl.keyStorePassword=changeit 5248( 5252) 11/19/2009 21:18:28 RTE D -Djava.net.preferIPv4Stack=true 5248( 5252) 11/19/2009 21:18:28 RTE E Error! CreateJavaVM() failed! rc = -4 5248( 5252) 11/19/2009 21:18:28 RTE E HP Service Manager is unable to start. Failed to initialize or attach to shared memory environment 5248( 5252) 11/19/2009 21:18:28 RTE E Could not create JVM.
Did you mean to try starting an sm.exe process from the command line by giving JVM options as arguments??? Is there any way to record that into a log rather than checking the task manager for seeing the cpu usage and memory ???
Look at pic. First time i have to start sm with incompatible by host amount of memory for Xmx setting (512) and got relevant error (Could not reserve). In case i will start sm with the same settings as a service i will not get same error - only rc=-4 one which says nothing.
Second time 100M lower - sm started in cmd. So i can play more, or put parameter in config file. Bingo.
In 7.10 I tried with the JVM options , it helped to bring down the number of times we restarted the servlet containers due to heap memory issues.
But everytime i tried with Xmx:512MB it failed.
Later as per the docs, i put Xms:254 and Xmx:254, it worked for me. why i didnt try this option is becoz in the KB article, HP has mentioned that for the garbage collection to work properly both xms and xmx shud be different.
Right now, after the upgrade to sm7.11, we are again facing with memory leakage issues which Hp is figuring out in the next release.
Now in my environment, instead of trying to increase the entire application heap, i have tried to increase the heap of each of the servlets . I have done this in the dev environment.
So are you aware of any work arounds for memory issues in sm7.11