Different Java heap size for 32- and 64-bit versions of the same release

2 次查看(过去 30 天)
I have need for both 32- and 64-bit R2015b on my Windows machine. I use 64-bit MATLAB most of the time and would like lots of Java heap space (2GB is usually a good amount since I have 32GB physical RAM). It will let me set the slider to 2048MB in Preferences just fine. However, I do occasionally need to use the 32-bit version. When I open it, it immediately complains that it can't start the JVM because there's not enough memory and that next time it'll go back to the default 256MB. But then that restricts the 64-bit version. The matlab.prf file doesn't appear to have any way of distinguishing 32- vs. 64-bit architecture to set it there. And a java.opts file isn't MATLAB syntax so I can't set it conditionally based on computer('arch') either. Any suggestions on a workaround so each build of a particular release can have a different max heap size?

采纳的回答

Michael
Michael 2017-9-21
编辑:Michael 2017-9-21
Nevermind... I just put the java.opts files in "C:\Program Files\MATLAB\R2015b\bin\win64" and "C:\Program Files (x86)\MATLAB\R2015b\bin\win32" rather than in the startup folder, setting appropriate limit (-Xmx2048m and -Xmx512m, respectively) in each location.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by