Bug 289565 - Variables view: 'All Instances' shows garbage collected instances
Summary: Variables view: 'All Instances' shows garbage collected instances
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 287852 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-16 05:21 EDT by Dani Megert CLA
Modified: 2022-09-02 19:25 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2009-09-16 05:21:29 EDT
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.
Comment 1 Dani Megert CLA 2009-09-16 05:29:18 EDT
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)
Comment 2 Curtis Windatt CLA 2009-09-17 10:08:37 EDT
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.
Comment 3 Darin Wright CLA 2009-10-22 15:18:36 EDT
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.
Comment 4 Darin Wright CLA 2009-10-22 15:40:55 EDT
When I use an IBM VM, instances do grow after hitting a breakpoint. However, using the GC button reduces the instances to 1.
Comment 5 Michael Rennie CLA 2011-06-29 10:53:16 EDT
*** Bug 287852 has been marked as a duplicate of this bug. ***
Comment 6 Michael Rennie CLA 2011-06-29 10:54:50 EDT
Bug 287852 comment#6 mentions this VM bug:

http://bugs.sun.com/view_bug.do?bug_id=4858370

adding it here for reference.
Comment 7 Eclipse Genie CLA 2020-08-02 16:40:49 EDT
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.
Comment 8 Eclipse Genie CLA 2022-09-02 19:25:17 EDT
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.