Launching another VM instance using Runtime.exec()

Hi,

I have two separate Swing applications, say A and B. I need to launch B from A using Runtime.exec() - essentially I am launching another VM instance from one VM. I am encountering strange problems - B's main window comes up, but GUI doesn't update; sometimes B comes up and GUI updates, but huge memory leaks happen. All the problems with B go away once A is shut down. It almost looks like both the instances of VM are sharing (or competing for) the event thread. Any comments will be of great help. Thanks.

note: There is no problem launching B if A is a console java application (i.e. no Swing GUI).

[635 byte] By [mandap] at [2007-9-26 4:47:41]
# 1
just try to start Runtime.exec("java.exe ...."); //the dots are for options Maybe it helps (i did not understand your problem or better i do not know you are using runtime yet or not)regards
swingfreak at 2007-6-29 18:37:33 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Thanks for the reply. I am using Runtime.exec("java.exe ....") and the second application is launching, but there are problems after the launch. Some of the problems went away when I listened to the second app's output & error streams in the first app. But still there are memory leaks happening..

mandap at 2007-6-29 18:37:33 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

I have recently had the same problem, especially with the part where it seems like the two applications are sharing or competing for the same event thread. Sometimes my application B hangs like it is stuck waiting for an event. Sometimes I can get it to unhang by moving the app window around or minimizing it. If it does break free, all the queued events occur in rapid succession. Anybody have any clue what's going on here? It's pretty annoying.

shawmike at 2007-6-29 18:37:33 > top of Java-index,Java HotSpot Virtual Machine,Specifications...