title: ObjectOutputStream getting struck
body: <p>A thread, which is responsible for writing on a socket (huge amount of data,around 4-5MBPS) is getting stuck, sometimes for as long as 15 minutes, and then comes to action again and then is getting stuck again with part stack trace as:</p>
  
  <pre><code> java.lang.Thread.State: RUNNABLE
      at java.net.SocketOutputStream.socketWrite0(Native Method)
      at java.net.SocketOutputStream.socketWrite(Unknown Source)
      at java.net.SocketOutputStream.write(Unknown Source)
      at java.io.BufferedOutputStream.write(Unknown Source)
      - locked &lt;0xa4ca4660&gt; (a java.io.BufferedOutputStream)
      mypackage.myMethod()
  </code></pre>
  
  <p>My immediate assumption was ObjectWrite is getting block.But this behavior is erratic at best.
  Underlying network seems okay. It has been writing successfully for hours before getting stuck.</p>
  
  <p>Thread also takes rest of at least 50ms before writing next chunk.
  So if it is not normal block, what else it could be?</p>
  
  <p>pstack:</p>
  
  <pre><code>ff2cba60 send     (10, 4dc230, c312, 0)
  fe03ce58 Java_java_net_SocketOutputStream_socketWrite0 (3a4928, c312, 10, 95f7f890, 0, c312) + 158
  fc093e5c * java/lang/System.getSecurityManager()Ljava/lang/SecurityManager;+3
  fc08ec3c * *java/net/SocketOutputStream.socketWrite([BII)V [compiled] +45
  fc08ec3c * *java/net/SocketOutputStream.write([BII)V+5
  fc005ab0 * java/io/BufferedOutputStream.write([BII)V+20
  fc005ab0 * mypackage.mymethod()V+84 (line 598)
  </code></pre>