2

I am running some computation on my Linux box and can't really afford to run it on battery while I drive home. It requires a network connection and currently I am running this stuff on a wireless connection. After reaching home, I need to hook up an ethernet cable to get the Internet.

I've never done this before but I want to "resume" the computation after reaching home. For that, I am thinking that I should suspend the eclipse program (which apparently I did not start from a terminal, so how would I suspend it?), put the system into standby. Then get the system out of standby, connect the ethernet cable, get a new IP address, then resume eclipse. I am assuming it will work.

Anyone has a better approach?

masegaloeh
  • 17,978
  • 9
  • 56
  • 104
Legend
  • 147
  • 3
  • 8

2 Answers2

3

Since you mentioned you're running Linux, you can use the kill command with the -STOP and -CONT arguments might be a more appropriate option to pause and resume the process.

First, open a terminal and get the PID using

ps aux

Then run

kill -STOP pid

where pid is the PID of your Java process.

To resume, run

kill -CONT pid

Brief tutorial here: http://tombuntu.com/index.php/2007/11/23/how-to-pause-a-linux-process

Another method would be to run your program in debug mode in Eclipse and pause it in the Debug view. However, running in debug mode will incur a nasty performance hit.

Note that the network connection in your program will probably need to be reopened (either due to changing networks or due to your connection getting closed due to timeout out on the other side), so you'll have to code some logic to detect a dropped network connection and reconnect.

rob
  • 1,253
  • 1
  • 10
  • 17
0

You can probably do it by running Jconsole.exe that is included within the Jre bin directory. Inside there, there is a way to send a pause "Operation" probably...

djangofan
  • 4,172
  • 10
  • 45
  • 59