I have a game implemented in Java that has a problem when running too much code from scripts: depending on the script language, the game may have these "hiccups" where the game will depend on a couple of frames each time and then, making the game " sluggish "from time to time.
After some research, I found this to happen when the garbage collector decided to run. After some research and testing, I found that using the incremental garbage collector (using the VM-VM parameter) fixes the problem. Yes, I know that the GC runs about 10% slower, but this is the cost I pay.
With this background information, now what I want to do is a .jar game package, as I have done so far, but I don’t know how to make the application use incremental GC without using -Xincgc, and I did not want to create .bat files /.sh, where before the user just had to double-click the .jar icon.
Is there a way to make .jar run with incremental GC without requiring any loader (.bat / .sh) or wrapper around it? Is there a way to enable this option in .jar?
source
share