rmi.transport.tcp.tcptransport Connectionhandler consumes much CPU
i am running an third party RMI-Server app providing exactly one method ("getImage()" returns an image as byte[]).
The implementation of this method (getting the image via a SOAP-WS) is provide by me.
The problem on running this RMI-Server is the high CPU consumption (measured with jvisualvm): 65% of cpu time go into开发者_如何学JAVA "sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run()"
and on second place with 15% is "sun.net.www.http.KeepAliveCache.run()"
. The "real" work (scaling the image) comes on 4th place.
The server is running on win 2003 server. i guess there is something wrong with resource/connection handling?? but is this an implementation problem or a windows configuration-problem?
another observation is: if cpu utilization is high the memory utilization goes also up - the question is: is this because the gc can't do its work or many images waiting to be delivered. all i can say the memoryis used for byte[]
.
so any ideas what to do?
thx in advance
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run() is the method that calls your remote implementations in the server, after marshalling the arguments and before marshalling the result. The timings probably mean that it takes more time to return the image over the wire as the RMI result than it does to scale the image.
I can only speculate that the byte array could be the image but it could be any number of things.
BTW are you running a multi core machine? I am also having this problem and found that VisualVM pointed at that same culprit at around 50% CPU utilization on the quad core Win7 machine and 100% on single core winXP. I am running Jetty for the server.
Sorry I can't answer the real question yet, but hope to hear a solution here or to be able to share one here soon. Since you ran into this a few months back maybe you already found one and can share?
精彩评论