vscode-java-debug icon indicating copy to clipboard operation
vscode-java-debug copied to clipboard

Debugging & inspection of variables causes com.sun.jdi.ObjectCollectedException

Open mozhuanzuojing opened this issue 4 years ago • 3 comments

[provide a description of the issue]

Debugging & inspection of variables causes com.sun.jdi.ObjectCollectedException

Environment
  • Operating System: Windows_NT x64 10.0.17134
  • JDK version: 16
  • Visual Studio Code version: 1.57.0-insider (system setup)
  • Java extension version: 0.79.1
  • Java Debugger extension version: 0.33.1
Steps To Reproduce
  1. View the contents of the variable collection in the breakpoint.
  2. switch 2 ~ 3 times Disable Logical Structure View and Enable Logical Structure View at Parent Collection Object and Child Collection Object. (Random combination)

Sometimes there will be problems

eclipse 4.18 has been resolved

Current Result

image

Expected Result

image

Additional Informations

mozhuanzuojing avatar May 08 '21 02:05 mozhuanzuojing

I have the same problem. In my case, I use ConcurrentHashMap<String, HashSet<String>>:

public void put(ConcurrentHashMap<String, HashSet<String>> mark) {
  HashSet<String> col = new HashSet();
  mark.put('1', col);
  col.put("abc');
}

When col end its life circle, the value of mark.get('1') become: com.sun.jdi.ObjectCollectedException

houtaru avatar Dec 27 '22 08:12 houtaru

This is still an issue in VSCode 1.81.1

robaho avatar Aug 23 '23 13:08 robaho