We have a 32-bit process A and it has to start another java jar which has to run in 64 bit process. They communicate though a socket. This system works fine.
But in some rare cases we see the second process (B) hangs until we close the process (A) that launches it. While I was debugging this issue I wanted to read input stream of process B to see what messages are being outputted and seen reading from the input stream of process B solved the issue. So we span up a dumb thread which solely reads input stream of the process B and everything worked fine.
The issue was very weird but we had to move on. We thought it has something to do with console output buffer size or something like that. But we have seen this issue appeared on a newly installed machine although we read the input stream of the started process (B).
Although it happens very rare we want to be absolutely sure why this happens. What might be the reason? Is there a default setting that we are not aware of? Have you encountered such a case before?
Quick summary:
- process A runs in a 32-bit process
- process B runs in a 64-bit process
- process A starts process B by issuing Runtime.exec by pointing to the 64-bit javaw.exe
- process B hangs until we close process A
- we see process B appears in the task manager