I am working in an java application where i want to make sure that a given process in the computer is idle
ex:- if we start a download process in our computer my application should be able to monitor it (process) and tell when it is over,
I am working in an java application where i want to make sure that
Share
Most operating systems provide user commands to monitor activity of a process, like CPU or I/O. Or, at a higher level, you can get the status (running or not) of a process by its process identifier. You could
execthese tools from Java, but there’s nothing in core Java to do this, nor am I aware of any libraries for this purpose.However, if you are thinking about killing a process because it is “idle”, that generally wouldn’t be safe. You have to know enough about the process in question to be sure it’s okay to kill it, and if you know that much about it, you’ll probably find that there’s a way to get it to shut itself down cleanly.