Community
Participate
Working Groups
I20090915-0100. The Variables view's 'All Instances' feature shows garbage collected instances. Might not be an Eclipse bug. Steps to reproduce: 1. start new workspace 2. import plug-in 'org.eclipse.jdt.junit.core' 3. open 'org.eclipse.jdt.internal.junit.model.TestRoot' 4. set a breakpoint in the constructor 5. Run > Debug As > Eclipse Application 6. paste this into the target: import junit.framework.TestCase; public class Foo extends TestCase { public void testIt() { } } 7. in the target: use Quick Fix to add the JUnit 3 library 8. in the target: Run > Run As > JUnit Test ==> debugger stops in dev workspace 9. resume debugger in dev workspace 10. repeat 8. and 9. several times 11. in the target: 'Show heap status' preference 12. in the target's status line: click 'Run Garbage Collector' several times 13. in the target: Run > Run As > JUnit Test ==> debugger stops in dev workspace 14. in dev workspace's Variables view select 'this' and open 'All Instances' ==> should only have max. two instances but has more ==> when looking at the references using the Variables view, some of those instances don't have one Using a memory analyzer proofs that there shouldn't be more than 2 instances.
VM: java version "1.6.0_16" Java(TM) SE Runtime Environment (build 1.6.0_16-b01) Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode)
AFAIK we query the vm for all instances and display them to the user. We don't cache them or do much with them at all. I would imagine this is a VM bug. Investigate in M3.
There does appear to be some debugger interaction here... if I just use the "Run As > JUnit Test" shortcut without using a breakpoint, the number of instances in memory does *not* grow. As soon as I use a breakpoint in TestRoot, the instances start to grow.
When I use an IBM VM, instances do grow after hitting a breakpoint. However, using the GC button reduces the instances to 1.
*** Bug 287852 has been marked as a duplicate of this bug. ***
Bug 287852 comment#6 mentions this VM bug: http://bugs.sun.com/view_bug.do?bug_id=4858370 adding it here for reference.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.