Created
April 30, 2020 00:07
-
-
Save henrikno/4eabd7a4cb5be2f37f9d86145e5cae39 to your computer and use it in GitHub Desktop.
Revisions
-
henrikno created this gist
Apr 30, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ PID=$(jps | grep Main | awk '{print $1}') CUR=$(jstat -gc $PID | tail -n 1 | awk '{split($0,a," "); sum=a[3]+a[4]+a[6]+a[8]; print sum/1024}') MAX=$(jstat -gccapacity $PID | tail -n 1 | awk '{split($0,a," "); sum=a[2]+a[8]; print sum/1024}') echo $CUR/$MAX