title: TimeoutException Occurred When Invoke JDI invokeMethod()
body: <p>I am developing my customized debugger as an eclipse plugin. I am using the JPDA API to this end. I would like to retrieve the value of some object-reference variable. Therefore, I try to use <a href="https://docs.oracle.com/javase/7/docs/jdk/api/jpda/jdi/com/sun/jdi/ObjectReference.html#invokeMethod(com.sun.jdi.ThreadReference,%20com.sun.jdi.Method,%20java.util.List,%20int)" rel="nofollow">ObjectReference.invokeMethod</a> by invoking toString() method. My code is as follows:</p>
  
  <pre><code>if(thread.isSuspended()){
      Method method = retriveToStringMethod(...);
      Value messageValue = objValue.invokeMethod(thread, method, new ArrayList&lt;Value&gt;(), ObjectReference.INVOKE_SINGLE_THREADED); 
      stringValue = messageValue.toString();
  
  }
  </code></pre>
  
  <p>However, it sometime does not work. For example, Given the following code:</p>
  
  <pre><code>1. public static void main(String[] args) {
  2.  InsertIntervalBug6 insert = new InsertIntervalBug6();
  3.  
  4.  Interval i1 = new Interval(1, 2);
  5.  Interval i2 = new Interval(3, 4);
  6.  
  7. }
  </code></pre>
  
  <p>It works fine in line 4, I can successfully get the result by invoking toString() method of <i>insert</i> variable. However, when in line 5, a TimeOutException is reported. However, I have already set the timeout option when starting JVM at 10s, therefore I think such a period is long enough to retrieve the result of toString() method invocation. The trace stack is as follows. Do you have any idea about the problem? Thanks!</p>
  
  <p>org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 586.
      at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186)
      at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197)
      at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191)
      at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226)
      at org.eclipse.jdi.internal.ObjectReferenceImpl.invokeMethod(ObjectReferenceImpl.java:428)
      at microbat.codeanalysis.runtime.variable.VariableValueExtractor.setMessageValue(VariableValueExtractor.java:518)</p>