Skip to content

java memory options not working. #2358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
willie68 opened this issue Oct 13, 2014 · 3 comments · Fixed by #2712
Closed

java memory options not working. #2358

willie68 opened this issue Oct 13, 2014 · 3 comments · Fixed by #2712

Comments

@willie68
Copy link

Due to some testing of issue #2233 i try to set some other memory parameters for the java vm. (-Xms and -Xmx...)
As i can see in the preference.txt file, it's possible to set an option part as i can set initial and max memory for the vm.

run.options=-Xms256m -Xmx1024m
run.options.memory=false
run.options.memory.initial=256
run.options.memory.maximum=256

There are 2 preferences.txrt files. One in the arduino install directory (which seem's to be the default one) and one in /AppData/Roaming/Arduino15/. But both will not work in any case. I have tried many different options, run.options.memory=false or run.options.memory=true
run.options= or run.options=-Xms256m -Xmx1024m but nothing changes the default behavier with -Xms128m and -Xmx128m...

@willie68
Copy link
Author

Just found out, that launch4j can be configured with a l4j.ini file. Must be in the same directory as the executable. Here you can define parameters.
But in the launch4j file (config.xml) the are the entries
<opt>-Xms128m -Xmx128m</opt>
And launch4j then add both, so you get a commandline with both options. Is it possible to delete the tag in the config.xml file and add an arduino.l4j.ini file with the default values for more flexibility?

arduino.l4j.ini
-Xms128m
-Xmx128m

see http://launch4j.sourceforge.net/docs.html#Additional_jvm_options

@WhiteElf
Copy link

Still having the same issue with 1.6.0.

Windows 7 64bit 16gb RAM.

Can't use any of the Open/Sketchbook/Examples options. Always get:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space

Executing this from the command line instead of running the loader solves the issue:
"D:\Utilities\Arduino\java\bin\javaw.exe" -Xms1024m -Xmx1024m -classpath "lib;lib\arduino-core.jar;lib\pde.jar;lib\jna.jar;lib\ecj.jar;lib\jssc-2.8.0.jar;lib\commons-codec-1.7.jar;lib\commons-exec-1.1.jar;lib\commons-httpclient-3.1.jar;lib\commons-logging-1.0.4.jar;lib\jmdns-3.4.1.jar;lib\jsch-0.1.50.jar" processing.app.Base

@WhiteElf
Copy link

Arduino-PR-2712-BUILD-197 resolves the heap space issue when attempting to load Sketch. It doesn't read the memory setting in the preferences.txt file, however it does work with the arduino.l4j.ini file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants