on 02-19-2013 3:28 PM
Hello All,
I seem to have a thread leak issue in my SAP JMX Client which uses RMI P4 protocol to connect to my AS JAVA server. I use my java application (JMX Client) to get the JMX data which I see using Netweaver Administrator. For this purpose, every 5 minutes, I get an MBeanServerConnection object as shown in the following SAP help page :
http://help.sap.com/saphelp_nw04/helpdata/en/64/617cfb94845d468b0498b4b2c53d74/content.htm
After getting the JMX data, I simply set the MBeanServerConnection variable to null as there seems to be no way to 'close' this JMX connection.
This, however, seems to keep creating a lot of threads in the 'waiting' state. I can see this using the jconsole application. These threads have a stack trace similar to the following stack trace :
> Name: Thread-51
> State: WAITING on com.sap.engine.services.rmi_p4.DispatchImpl@1e6cf07
> Total blocked: 84 Total waited: 85
> Stack trace:
> java.lang.Object.wait(Native Method)
> java.lang.Object.wait(Object.java:485)
> com.sap.engine.services.rmi_p4.DispatchImpl.run(DispatchImpl.java:602)
> java.lang.Thread.run(Unknown Source)
This issue seems to be the cause for my production server crash by creating more than 1000 such waiting threads over a period of time. Even in my development server, with no load, about 10 new waiting threads have been added in a period of 90 minutes and the waiting threads are always in waiting state and never go away thereby causing a pile up.
Do you know of a fix for this? Is there any SAP note I can refer to for this? Could this issue be due to periodically getting MBeanServerConnection objects? If so, could I just create an MBeanServerConnection object once and reuse it every 5 minutes?
Please advise. Thank you verhy much
-Regards,
Arvind
Hi Arvind,
Please have a look at this link -
http://help.sap.com/saphelp_nw04/helpdata/en/64/617cfb94845d468b0498b4b2c53d74/frameset.htm
This link gives details about administration of Adapter service. This way your need to manually modify MBeanServerConnection properties will go away which is the cause of waiting threads.
Hope this helps,
Regards,
Ashutosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashutosh,
Thanks for your reply. We are also facing the same issue.
We use External JMX connection as suggested in the link that you have suggested.
But Still we see the waiting threads growing over time.
Stack trace:
> java.lang.Object.wait(Native Method)
> java.lang.Object.wait(Object.java:485)
> com.sap.engine.services.rmi_p4.DispatchImpl.run(DispatchImpl.java:602)
> java.lang.Thread.run(Unknown Source)
//
set the connection properties for the RMI-P4 connection
Properties
connectionProperties = new
Properties();
"com.sap.engine.services.jndi.InitialContextFactoryImpl");
//
create the MBeanServerConnection
MBeanServerConnection mbsc = JmxConnectionFactory.getMBeanServerConnection(JmxConnectionFactory.
PROTOCOL_ENGINE_P4,
connectionProperties);
Thanks
Hari
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.