Questions tagged [processhandle]
6 questions
6
votes
1 answer
ProcessHandle onExit has empty data
I'm currently testing Process API from java 9 and I have some problem with following code:
Process process = new ProcessBuilder( List.of("ping", "-i", "1", "-c", "4", "google.com")).start();
CompletableFuture startTimeFuture =…

Maciek Murawski
- 414
- 4
- 15
3
votes
1 answer
How to kill the current process with java 9
I have tried with both destroy and destroyForcibly using the below code -
ProcessHandle currentProcess = ProcessHandle.current();
System.out.println("current process id:"+currentProcess.getPid());
currentProcess.destroyForcibly();
but getting an…

Sudarsana Kasireddy
- 922
- 1
- 8
- 24
2
votes
2 answers
Java 9 ProcessHandle API in Docker: Difference in PID values and visible processes
While trying the new ProcessHandle API in Java 9 on a simple "Dockerized" Java program, I found a difference in terms of behavior when it comes to retrieving process IDs of running processes. Specifically when calling the method ProcessHandle.pid(),…

M A
- 71,713
- 13
- 134
- 174
0
votes
1 answer
ProcessHandle returns ambiguous results
I've two Java 11 methods that check whether a process for a given PID is running:
public static final boolean isProcessRunning( final long pid ) {
Optional< ProcessHandle > optionalProcess = ProcessHandle.of( pid );
return…

Tobias F.
- 3
- 1
0
votes
1 answer
"No value present" when calling `ProcessHandle`'s `parent().get()`
import java.lang.ProcessBuilder.Redirect;
public class Main {
public static void main(String args[]){
ProcessBuilder pb = new ProcessBuilder(args);
try{
Process p = pb.start();
System.out.println("child process is alive: " +…

Tim
- 1
- 141
- 372
- 590
0
votes
1 answer
C# Log4Net High process Handles usage
I created a windows service using C# and i was monitoring the application thread and handle use through performance monitor (This service looks at defined paths in app.config and clears defined file type that is older than X hours, the service is…

Yazzan
- 1
- 1