所有
我在运行程序时使用以下VM开关。该程序具有已知的内存泄漏。
最初堆已满,我理解OutOfMemoryError的原因。但是后来(124.283),一个完整的GC回收了一些空间。那么为什么我仍然得到OutOfMemoryError?
提前致谢
-XX:+ PrintGCTimeStamps -XX:+ PrintGCDetails -Xms32m -Xmx32m
堆满了
123.540:[Full GC 123.540:[Tenured:21888K-> 21887K(21888K),0.1215501 secs] 31679K-> 31679K(31680K),[Perm:2054K-> 2054K(12288K)],0.1216037 secs] [时间:用户= 0.13 sys = 0.00,实际= 0.13秒] 123.665:[Full GC 123.665:[Tenured:21887K-> 21887K(21888K),0.1504579 secs] 31679K-> 31575K(31680K),[Perm:2054K-> 2054K(12288K)],0.1505627 secs] [次: user = 0.16 sys = 0.00,real = 0.16 secs] 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" AWT-EventQueue-0" java.lang.NullPointerException:disposed at sun.java2d.windows.GDIWindowSurfaceData.initOps(Native Method) at sun.java2d.windows.GDIWindowSurfaceData。(未知来源) at sun.java2d.windows.GDIWindowSurfaceData.createData(Unknown Source) at sun.awt.Win32GraphicsConfig.createSurfaceData(Unknown Source) at sun.java2d.ScreenUpdateManager.createScreenSurface(未知来源) at sun.java2d.d3d.D3DScreenUpdateManager.createScreenSurface(未知来源) at sun.awt.windows.WComponentPeer.replaceSurfaceData(Unknown Source) at sun.awt.windows.WComponentPeer.replaceSurfaceData(Unknown Source) 在sun.awt.windows.WComponentPeer $ 2.run(未知来源) 在javax.swing.RepaintManager.seqPaintDirtyRegions(未知来源) at javax.swing.SystemEventQueueUtilities $ ComponentWorkRequest.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) 123.829:[Full GC 123.829:[Tenured:21887K-> 21887K(21888K),0.1306163 secs] 31679K-> 30695K(31680K),[Perm:2056K-> 2056K(12288K)],0.1306809 secs] [时间: user = 0.13 sys = 0.00,real = 0.13 secs] 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 124.040:[Full GC 124.040:[Tenured:21888K-> 21887K(21888K),0.1259948 secs] 31680K-> 27400K(31680K),[Perm:2057K-> 2057K(12288K)],0.1260596 secs] [次: user = 0.13 sys = 0.00,real = 0.13 secs]
在以下Full GC中回收堆内存
124.283:[Full GC 124.283:[Tenured:21888K-> 15215K(21888K),0.0945810 secs] 31680K-> 15215K(31680K),[Perm:2057K-> 2055K(12288K)],0.0946383 secs] [时间:用户= 0.09 sys = 0.00,实际= 0.09秒] 124.829:[GC 124.829:[DefNew:8704K-> 988K(9792K),0.0079326 secs] 23919K-> 16203K(31680K),0.0079854 secs] [次:用户= 0.00 sys = 0.00,real = 0.00 secs] 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间 线程中的异常" RMI TCP连接(空闲)" java.lang.OutOfMemoryError:Java堆空间