From 44839208f747c5b1eba95103983dacefc3281b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 26 Oct 2017 15:02:20 +0200 Subject: [PATCH] jmavsim_run.sh: add more aggressive GC option This reduces memory usage by roughly 100MB on my laptop --- Tools/jmavsim_run.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tools/jmavsim_run.sh b/Tools/jmavsim_run.sh index 69dd0f1eb3..704833d17a 100755 --- a/Tools/jmavsim_run.sh +++ b/Tools/jmavsim_run.sh @@ -43,4 +43,12 @@ fi ant create_run_jar copy_res cd out/production -java -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args + +java -XX:GCTimeRatio=20 -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args +ret=$? +if [ $ret -ne 0 -a $ret -ne 130 ]; then # 130 is Ctrl-C + # if the start of java fails, it's probably because the GC option is not + # understood. Try starting without it + java -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args +fi +