Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# PID 1 is the process that I want to observe
$ ps -p 1 -o args
COMMAND
java -Dvertx.cacheDirBase=/tmp -javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/etc/jolokia.properties -XX:+UseParallelGC -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:GCTimeRati
# best alternatives when the above method truncate the command
## alt-1
$ xargs -0 printf '%s\n' </proc/1/cmdline
java
-Dvertx.cacheDirBase=/tmp
-javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/etc/jolokia.properties
-XX:+UseParallelGC
-XX:MinHeapFreeRatio=20
-XX:MaxHeapFreeRatio=40
-XX:GCTimeRatio=4
-XX:AdaptiveSizePolicyWeight=90
-XX:MaxMetaspaceSize=100m
-XX:+ExitOnOutOfMemoryError
-cp
.
-jar
/deployments/booster-rest-http-1.0.0-SNAPSHOT.jar
## alt-2
$ cat /proc/1/cmdline
java-Dvertx.cacheDirBase=/tmp-javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/etc/jolokia.properties-XX:+UseParallelGC-XX:MinHeapFreeRatio=20-XX:MaxHeapFreeRatio=40-XX:GCTimeRatio=4-XX:AdaptiveSizePolicyWeight=90-XX:MaxMetaspaceSize=100m-XX:+ExitOnOutOfMemoryError-cp.-jar/deployments/booster-rest-http-1.0.0-SNAPSHOT.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.