1

I am using jetty version 8.1.8.v20121106 and have a quite simple spring mvc application deployed. During server uptime the memory commitment is increasing until the server fails.

Memory commitment over time

Also threads are increasing dramatically over time

enter image description here

I have a lot of sleeping and waiting for event threads, as you can see here

root      1568  2.9 12.4 14014884 4111368 ?    Sl   10:03   0:07 /usr/bin/java -Djetty.home=/opt/jetty/jetty -Djava.io.tmpdir=/tmp -javaagent:/home/ydadmin/newrelic/newrelic.jar -jar /opt/jetty/jetty/star
root      1568  0.7 12.4 14014884 4111368 ?    Sl   10:03   0:02 /usr/bin/java -Djetty.home=/opt/jetty/jetty -Djava.io.tmpdir=/tmp -javaagent:/home/ydadmin/newrelic/newrelic.jar -jar /opt/jetty/jetty/star
root      1568  0.0 12.4 14014884 4111368 ?    Sl   10:03   0:00 /usr/bin/java -Djetty.home=/opt/jetty/jetty -Djava.io.tmpdir=/tmp -javaagent:/home/ydadmin/newrelic/newrelic.jar -jar /opt/jetty/jetty/star
root      1568  0.0 12.4 14014884 4111368 ?    Sl   10:03   0:00 /usr/bin/java -Djetty.home=/opt/jetty/jetty -Djava.io.tmpdir=/tmp -javaagent:/home/ydadmin/newrelic/newrelic.jar -jar /opt/jetty/jetty/star

I am assuming it is because of lack in jetty pooling and not closing old connections, but why and how to solve that? My config currently looks like this: http://pastebin.com/NDrUKwCv

How can I find out, what is causing this issue?

UPDATE: found with jsstack a lot of this threads maybe those can help

http://pastebin.com/7Ybt5NCv

4

1 回答 1

2

在分析了我使用线程的所有部分之后,结果发现我错过了关闭 aExecutor这对垃圾收集不利。

ExecutorService executor = Executors.newFixedThreadPool(2);
// ...
executor.shutdown()
于 2013-06-05T11:46:59.377 回答