Hi Peter.
Thanks a lot for your reply.
I have established connection with remote debugger to the remote
servlet. The breakpoint has been set in doPost method. I have another session with the debugger in the code which posts using HttpURLConnection. I can see that remote sites trips the breakpoint only after I am done with the loop and call "getResponseCode" method.
The reason I noticed this problem I am trying to post 90M file to remote site. While this code works fine for smaller files, this file causes "OutOfMemoryException". I have ran the code which posts using hprof switch ( -Xrunhprof ) and it showed a lot of heap allocations in the traces reading file in the loop.