Skip to content

Commit

Permalink
generate gnuplot for proc memory
Browse files Browse the repository at this point in the history
  • Loading branch information
sendaoYan committed Sep 12, 2024
1 parent 41e6d1a commit 2f10061
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ getMemoryUsageFromProc()
do
sleep 0.1 #wait util java main function start finish
done
rm -rf proc-*.log
mkdir -p plot-data
rm -rf proc-*.csv plot-data/proc-*.txt
echo -n "VmSize" > proc-VmSize.csv
echo -n "VmRSS" > proc-VmRSS.csv
echo -n "PageNum" > proc-PageNum.csv
i=0
while kill -0 ${pid} 2>/dev/null
do
VmSize=`grep -w VmSize /proc/${pid}/status | awk '{print $2}'`
Expand All @@ -131,6 +133,10 @@ getMemoryUsageFromProc()
echo -n ",${VmSize}" >> proc-VmSize.csv
echo -n ",${VmRSS}" >> proc-VmRSS.csv
echo -n ",${PageNum}" >> proc-PageNum.csv
echo "${i} ${VmSize}" >> plot-data/proc-VmSize.txt
echo "${i} ${VmRSS}" >> plot-data/proc-VmRSS.txt
echo "${i} ${PageNum}" >> plot-data/proc-PageNum.txt
let i++;
fi
sleep 2
done
Expand All @@ -150,9 +156,9 @@ generatePlotPNG()
echo please install gnuplot command!
return
fi
for file in `ls plot-data | grep "\.csv$"`
for file in `ls plot-data | grep "\.txt$"`
do
name=`basename $file .csv`
name=`basename $file .txt`
echo plot ${name}
gnuplot -c ${TESTSRC}/plot.gp "plot-data/${file}" "${name}" "plot-data/${name}.png"
done
Expand All @@ -169,7 +175,7 @@ commonJvmOptions="-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteB

rm -rf java.log
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${TESTJAVAOPTS} -XX:+SegmentedCodeCache ${commonJvmOptions} \
-Dtest.src=${TESTSRC} -cp ${TESTCLASSPATH} compiler.codecache.stress.UnexpectedDeoptimizationTestLoop &> java.log &
-Dtest.src=${TESTSRC} -cp ${TESTCLASSPATH} compiler.codecache.stress.UnexpectedDeoptimizationTestLoop 40 &> java.log &
pid=$!
ps -ef | grep java | grep UnexpectedDeoptimizationTestLoop &> ps-java.log
getMemoryUsageFromProc ${pid} java.log 2> proc-detail-stderr.log &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@

public class UnexpectedDeoptimizationTestLoop extends UnexpectedDeoptimizationTest {
public static void main(String[] args) {
for (int i = 0; i < 2; i++) {
int loop = 25;
if (args.length != 0) {
loop = Integer.valueOf(args[0]);
}
System.out.println("loop count = " + loop);
for (int i = 0; i < loop; i++) {
new CodeCacheStressRunner(new UnexpectedDeoptimizationTest()).runTest();
}
}
Expand Down

0 comments on commit 2f10061

Please sign in to comment.