HeapFragger
HeapFragger copied to clipboard
Unable to run heapfragger in background
I need to execute a long-running (several hours) HeapFragger session on a remote machine which requires me to run it in the background using nohup to avoid aborted session due to connection timeout. When I try to run HeapFragger with nohup or in the background, eg
openj9/jdk-11.0.1+13/bin/java -Xmx2g -Xms2g -verbose:gc -Xverbosegclog:d.vlog \
-javaagent:HeapFragger.jar="-a 512 -s 0" \
-javaagent:jHiccup.jar="-d 0 -i 1000 -l d.hlog" \
org.HeapFragger.Idle -t 100000 &>>d.err&
it returns immediately without output to stdout/stderr. The hiccup log is also empty and the verbose gc log shows only its initialization header, no collections are recorded. If I remove the trailing ampersand and run it in the foreground it runs as expected. Same behavior with OpenJDK as for OpenJ9.
I am attempting to run this on an x86-64 server running Red Hat Enterprise Linux 7.5 with 16 cores and ~18G RAM.
It seems that HeapFragger is trying to read from tty while running in the background:
jobs -l
[1]+ 6302 Stopped (tty input) openj9/jdk-11.0.1+13/bin/java -Xmx2g -Xms2g -verbose:gc -Xverbosegclog:d.vlog -javaagent:HeapFragger.jar="-a 512 -s 0" -javaagent:jHiccup.jar="-d 0 -i 1000 -l d.hlog" org.HeapFragger.Idle -t 100000 &> d.err
Is there a way to disable this and enable HeapFragger to run in the background?