Subject: | memory leak |
I tried to loop-run simple perl program( only call new Java, my $java =
new Java(host => "192.168.0.218", port => 9191, event_port => -1);)
The program was stopped at 3621 count.
--- JavaServer's message -------------------------------
Exception in thread "Javaserver TCPServer #3621"
java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:39)
at java.nio.ByteBuffer.allocate(ByteBuffer.java:312)
at
sun.nio.cs.StreamEncoder$CharsetSE.<init>(StreamEncoder.java:310)
at
sun.nio.cs.StreamEncoder$CharsetSE.<init>(StreamEncoder.java:290)
at
sun.nio.cs.StreamEncoder$CharsetSE.<init>(StreamEncoder.java:274)
at
sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:69)
at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:93)
at com.zzo.javaserver.SocketHandler.run(SocketHandler.java:86)
at com.zzo.javaserver.TCPServer.run(TCPServer.java:191)
at java.lang.Thread.run(Thread.java:595)
The memory was exhausted on Java heap space. : requested 8208 bytes
Java heap size / max Java heap size = 66046696 / 67108864
Java perm size / max Java perm size = 2306536 / 67108864
-------------------------------------------------------------------
--- JavaServer's -Xrunhprof --------------------------------
TRACE 301951:
java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:39)
java.nio.ByteBuffer.allocate(ByteBuffer.java:312)
sun.nio.cs.StreamDecoder$CharsetSD.<init>(StreamDecoder.java:378)
sun.nio.cs.StreamDecoder$CharsetSD.<init>(StreamDecoder.java:358)
sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:74)
java.io.InputStreamReader.<init>(InputStreamReader.java:57)
com.zzo.javaserver.SocketHandler.run(SocketHandler.java:84)
com.zzo.javaserver.TCPServer.run(TCPServer.java:191)
java.lang.Thread.run(Thread.java:595)
TRACE 302252:
java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:39)
java.nio.ByteBuffer.allocate(ByteBuffer.java:312)
sun.nio.cs.StreamEncoder$CharsetSE.<init>(StreamEncoder.java:310)
sun.nio.cs.StreamEncoder$CharsetSE.<init>(StreamEncoder.java:290)
sun.nio.cs.StreamEncoder$CharsetSE.<init>(StreamEncoder.java:274)
sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:69)
java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:93)
com.zzo.javaserver.SocketHandler.run(SocketHandler.java:167)
com.zzo.javaserver.TCPServer.run(TCPServer.java:191)
java.lang.Thread.run(Thread.java:595)
SITES BEGIN (ordered by live bytes) Tue Oct 12 11:03:28 2010
percent live alloc'ed stack class
rank self accum bytes objs bytes objs trace name
1 45.62% 45.62% 29712960 3620 29721168 3621 301951 byte[]
2 45.62% 91.24% 29712960 3620 29712960 3620 302252 byte[]
3 0.67% 91.91% 434640 3622 434640 3622 301876
java.net.SocksSocketImpl
-------------------------------------------------------------------
--- JavaServer's jstat -gc -t 30190 1s --------------------------------
Timestamp S0C S1C S0U S1U EC EU OC
OU PC PU YGC YGCT FGC FGCT GCT
48.0 512.0 512.0 0.0 0.0 3072.0 475.1 1408.0
0.0 16384.0 1988.6 0 0.000 0 0.000 0.000
49.0 512.0 512.0 0.0 0.0 3072.0 2213.4 1408.0
0.0 16384.0 2180.5 0 0.000 0 0.000 0.000
50.0 512.0 512.0 0.0 496.6 3072.0 589.9 1408.0
0.0 16384.0 2187.4 1 0.004 0 0.000 0.004
51.0 512.0 512.0 0.0 496.6 3072.0 1966.6 1408.0
0.0 16384.0 2188.0 1 0.004 0 0.000 0.004
52.0 512.0 512.0 0.0 0.0 3072.0 253.5 3392.0
1137.8 16384.0 2192.7 2 0.009 1 0.017 0.026
53.0 512.0 512.0 0.0 0.0 3072.0 2041.4 3392.0
1137.8 16384.0 2200.2 2 0.009 1 0.017 0.026
..........................
..........................
..........................
327.8 896.0 512.0 0.0 0.0 5312.0 5306.2 58304.0
58298.7 16384.0 2252.5 131 1.195 132 12.442 13.637
328.8 896.0 512.0 0.0 0.0 5312.0 5306.2 58304.0
58298.7 16384.0 2252.5 131 1.195 132 12.442 13.637
329.4 896.0 512.0 0.0 0.0 5312.0 5285.8 58304.0
58298.3 16384.0 2258.5 131 1.195 136 12.971 14.165
329.4 896.0 512.0 0.0 0.0 5312.0 5285.8 58304.0
58298.3 16384.0 2258.5 131 1.195 136 12.971 14.165
-------------------------------------------------------------------
shutdownables(TCPServer.java) is extend 2 size every request from perl.
but shutdownables(TCPServer.java) have not been released ?