Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to give Java more memory reliably?

Tags:

java

memory

For a specific java program I needed more memory then the standard amount, but I cannot use command line to get more because it uses a launcher.

I tried adding "-Xms1024m -Xmx1024m" to the runtime parameters in the Java Control Panel, this worked once but the next time I started the program the memory was back to the low default. How can I reliably get more memory for this program?

like image 691
Kelvin Bongers Avatar asked May 10 '26 19:05

Kelvin Bongers


1 Answers

Most launchers (at least the ones I saw) give you the option to apply jvm parameters. This is where you can add your -Xms1024m -Xmx1024m. For instance in Launch4J, you can set it like this:

Launch4J JRE settings

You can see at the bottom, that you can also put in your own parameters, though the memory stuff is already given as an individual option. I bet your launcher app can do that too.

like image 105
brimborium Avatar answered May 13 '26 09:05

brimborium



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!