title: Eclipse: Debugging & inspection of variables causes com.sun.jdi.ObjectCollectedException
body: <p>I debug my program and add here and there a breakpoint. After a stop I want to inspect some of the variables and get sometimes a <code>com.sun.jdi.ObjectCollectedException</code>. After searching in different sources I figured out that most likely the object was <strong>G</strong>arbage <strong>C</strong>ollected. Clicking here and there I could retrieve my object by nevertheless in the <code>Variables</code> view I cannot inspect the variable.</p>
  
  <pre><code>-vmargs
  -Dosgi.requiredJavaVersion=1.8
  -Dosgi.instance.area.default=@user.home/eclipse-workspace
  -XX:+UseG1GC
  -XX:+UseStringDeduplication
  --add-modules=ALL-SYSTEM
  -Dosgi.requiredJavaVersion=1.8
  -Xms512m
  -Xmx4096m
  --add-modules=ALL-SYSTEM
  </code></pre>
  
  <p>I'm running under Linux/OpenSuSe with OpenJDK 1.8.0_151. Any hints how to avoid that kind of GC problems? Is this some kind of setting in the IDE?</p>