Skip to content

Instantly share code, notes, and snippets.

@rondinif
Created February 1, 2018 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rondinif/04a91afdbc836d937698bef0469494c0 to your computer and use it in GitHub Desktop.
Save rondinif/04a91afdbc836d937698bef0469494c0 to your computer and use it in GitHub Desktop.
# 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