1.5 Swing Memory Leak Affecting IDEA when Hibernating WinXP Laptop

There is an outstanding Swing memory leak bug that I believe is afflicting IDEA 6.0. If I hibernate my WinXP laptop with IDEA running, when I open it up again IDEA has some sever memory problems. There is a solution to this that involves replacing the RepaintManager with a derivation that allows the memory to be freed up. See Nicholas Ethan's blog entry on this difficult to find problem and Sun's Bug Parade# 6209673]]>.

2 comments

Hello Gregory,

Thanks a lot for the link. I've just coded the same hack for IDEA and now
wonder if that's safe enough to integrate into 6.0.x branch blindly...

-


Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

There is an outstanding Swing memory leak bug that I believe is
afflicting IDEA 6.0. If I hibernate my WinXP laptop with IDEA
running, when I open it up again IDEA has some sever memory problems.
There is a solution to this that involves replacing the RepaintManager
with a derivation that allows the memory to be freed up. See Nicholas
Ethan's <a
href=http://weblogs.java.net/blog/enicholas/archive/2006/04/leaking_ev
il.html">blog</a> entry on this difficult to find problem and Sun's
Bug Parade# <a
href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6209673">6209
673</a>.



0

Max,

Seems that something isn't working correctly yet. I'm getting lots of
exceptions:

2006-10-31 07:04:47,125 ERROR -
com.intellij.ide.IdeEventQueue - IntelliJ IDEA 6.0.2 Beta Build #6522
2006-10-31 07:04:47,125 ERROR -
com.intellij.ide.IdeEventQueue - JDK: 1.5.0_08
2006-10-31 07:04:47,125 ERROR -
com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) Client VM
2006-10-31 07:04:47,125 ERROR -
com.intellij.ide.IdeEventQueue - Vendor: Sun Microsystems Inc.
2006-10-31 07:04:47,125 ERROR -
com.intellij.ide.IdeEventQueue - OS: Windows XP
2006-10-31 07:04:47,125 ERROR -
com.intellij.ide.IdeEventQueue - Last Action:
2006-10-31 07:04:47,859 ERROR -
tellij.ide.HackyRepaintManager -
java.lang.IllegalAccessException: Class
com.intellij.ide.HackyRepaintManager can not access a member of class
javax.swing.RepaintManager with modifiers "private"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.reflect.Field.doSecurityCheck(Field.java:954)
at java.lang.reflect.Field.getFieldAccessor(Field.java:895)
at java.lang.reflect.Field.get(Field.java:357)
at com.intellij.ide.HackyRepaintManager.a(HackyRepaintManager.java:14)
at
com.intellij.ide.HackyRepaintManager.getVolatileOffscreenBuffer(HackyRepaintManager.java:15)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4902)
at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:79)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:143)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:55)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
2006-10-31 07:04:47,859 ERROR -
tellij.ide.HackyRepaintManager - IntelliJ IDEA 6.0.2 Beta Build #6522
2006-10-31 07:04:47,859 ERROR -
tellij.ide.HackyRepaintManager - JDK: 1.5.0_08
2006-10-31 07:04:47,859 ERROR -
tellij.ide.HackyRepaintManager - VM: Java HotSpot(TM) Client VM
2006-10-31 07:04:47,859 ERROR -
tellij.ide.HackyRepaintManager - Vendor: Sun Microsystems Inc.
2006-10-31 07:04:47,859 ERROR -
tellij.ide.HackyRepaintManager - OS: Windows XP
2006-10-31 07:04:47,859 ERROR -
tellij.ide.HackyRepaintManager - Last Action:
2006-10-31 07:04:47,859 ERROR -
com.intellij.ide.IdeEventQueue - Error during dispatching of
java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=javax.swing.SystemEventQueueUtilities$ComponentWorkRequest@ccdcea,notifier=null,catchExceptions=false,when=1162274687859]
on sun.awt.windows.WToolkit@28bda
java.lang.NullPointerException
at com.intellij.ide.HackyRepaintManager.a(HackyRepaintManager.java:1)
at
com.intellij.ide.HackyRepaintManager.getVolatileOffscreenBuffer(HackyRepaintManager.java:15)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4902)
at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:79)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:143)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:55)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


Maxim Shafirov (JetBrains) wrote:

Hello Gregory,

Thanks a lot for the link. I've just coded the same hack for IDEA and
now wonder if that's safe enough to integrate into 6.0.x branch blindly...

------------------
Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> There is an outstanding Swing memory leak bug that I believe is
>> afflicting IDEA 6.0. If I hibernate my WinXP laptop with IDEA
>> running, when I open it up again IDEA has some sever memory problems.
>> There is a solution to this that involves replacing the RepaintManager
>> with a derivation that allows the memory to be freed up. See Nicholas
>> Ethan's > href=http://weblogs.java.net/blog/enicholas/archive/2006/04/leaking_ev >> il.html">blog entry on this difficult to find problem and Sun's >> Bug Parade# > href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6209673">6209 >> 673. >>]]>



--
Martin Fuhrer
Fuhrer Engineering AG
http://www.fuhrer.com

0

Please sign in to leave a comment.