restlet / restlet-framework-java

The first REST API framework for Java
https://restlet.talend.com
648 stars 284 forks source link

consuming high CPU #794

Open wimjongman opened 10 years ago

wimjongman commented 10 years ago

What I see is that a webservice call from the browser will timeout after exactly 60 seconds. Returning to the server I see a high CPU consumption. When comparing stack dumps this is a typical output:

wim@gravity:~/temp$ diff d2.out d3.out 7,8c7,8 < - java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object, long) @bci=20, line=226 (Interpreted frame)

< - java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(java.util.concurrent.SynchronousQueue$TransferStack$SNode, boolean, long) @bci=174, line=453 (Compiled frame)

  • java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, line=186 (Interpreted frame)
  • java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(java.util.concurrent.SynchronousQueue$TransferStack$SNode, boolean, long) @bci=158, line=451 (Compiled frame) 10,11c10,11 < - java.util.concurrent.SynchronousQueue.poll(long, java.util.concurrent.TimeUnit) @bci=11, line=903 (Interpreted frame) < - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=141, line=1069 (Interpreted frame)

  • java.util.concurrent.SynchronousQueue.take() @bci=7, line=886 (Interpreted frame)
  • java.util.concurrent.ThreadPoolExecutor.getTask() @bci=156, line=1069 (Interpreted frame) 173,191c173,178 < - sun.nio.ch.FileDispatcher.read0(java.io.FileDescriptor, long, int) @bci=0 (Compiled frame; information may be imprecise) < - sun.nio.ch.SocketDispatcher.read(java.io.FileDescriptor, long, int) @bci=4, line=39 (Compiled frame) < - sun.nio.ch.IOUtil.readIntoNativeBuffer(java.io.FileDescriptor, java.nio.ByteBuffer, long, sun.nio.ch.NativeDispatcher, java.lang.Object) @bci=116, line=251 (Compiled frame) < - sun.nio.ch.IOUtil.read(java.io.FileDescriptor, java.nio.ByteBuffer, long, sun.nio.ch.NativeDispatcher, java.lang.Object) @bci=55, line=224 (Compiled frame) < - sun.nio.ch.SocketChannelImpl.read(java.nio.ByteBuffer) @bci=101, line=254 (Compiled frame) < - org.restlet.engine.io.ReadableSocketChannel.read(java.nio.ByteBuffer) @bci=21, line=82 (Compiled frame) < - org.restlet.engine.connector.Connection$1.read(java.nio.ByteBuffer) @bci=9, line=232 (Compiled frame) < - org.restlet.engine.io.Buffer.fill(java.nio.channels.ReadableByteChannel) @bci=16, line=395 (Compiled frame) < - org.restlet.engine.connector.InboundWay.onFill(org.restlet.engine.io.Buffer, java.lang.Object[]) @bci=11, line=284 (Compiled frame) < - org.restlet.engine.io.Buffer.process(org.restlet.engine.io.BufferProcessor, int, java.lang.Object[]) @bci=442, line=601 (Compiled frame) < - org.restlet.engine.connector.Way.processIoBuffer() @bci=10, line=503 (Compiled frame) < - org.restlet.engine.connector.InboundWay.processIoBuffer() @bci=124, line=360 (Compiled frame) < - org.restlet.engine.connector.Way.onSelected(org.restlet.util.SelectionRegistration) @bci=173, line=456 (Compiled frame) < - org.restlet.util.SelectionRegistration.onSelected(int) @bci=24, line=325 (Compiled frame) < - org.restlet.engine.connector.Connection.onSelected(org.restlet.util.SelectionRegistration) @bci=132, line=612 (Compiled frame) < - org.restlet.util.SelectionRegistration.onSelected(int) @bci=24, line=325 (Compiled frame) < - org.restlet.engine.connector.ConnectionController.onSelected(java.nio.channels.SelectionKey) @bci=69, line=219 (Compiled frame) < - org.restlet.engine.connector.ServerConnectionController.onSelected(java.nio.channels.SelectionKey) @bci=9, line=99 (Compiled frame) < - org.restlet.engine.connector.ConnectionController.selectKeys(long) @bci=174, line=308 (Compiled frame)

  • sun.nio.ch.EPollArrayWrapper.epollWait(long, int, long, int) @bci=0 (Compiled frame; information may be imprecise)
  • sun.nio.ch.EPollArrayWrapper.poll(long) @bci=18, line=228 (Compiled frame)
  • sun.nio.ch.EPollSelectorImpl.doSelect(long) @bci=28, line=83 (Compiled frame)
  • sun.nio.ch.SelectorImpl.lockAndDoSelect(long) @bci=37, line=87 (Compiled frame)
  • sun.nio.ch.SelectorImpl.select(long) @bci=30, line=98 (Compiled frame)
  • org.restlet.engine.connector.ConnectionController.selectKeys(long) @bci=78, line=297 (Compiled frame)
wimjongman commented 10 years ago

I filed another bug for the same problem here #805 with more information. I should have done it here but I forgot I filed this already. I'm sorry for that.

bitsofinfo commented 7 years ago

status? this is 2 year old