Java Heap Memory on Mac OS X
조회 수: 11 (최근 30일)
이전 댓글 표시
The highest I can set it to on my Mac is 256MB, while on a 64-bit Windows machine it is ~1500MB. Is there a reason for this and/or a way around it?
댓글 수: 0
답변 (1개)
Shashank Prasanna
2013년 2월 28일
I think the limit is a 1/4 of your total RAM or memory. Are you referring to the same machine? Your windows machine probably has 6gb of ram while mac has 1gb of ram.
You can increase beyond that by manually editing the java.opts file, but it is not recommended.
댓글 수: 5
Shashank Prasanna
2013년 7월 25일
I did some digging and it seems that the limit on mac correct. The workaround to change it beyond that is to edit the java.opts file.
There is info on how to go about doing this in the following solutions page:
Ryan
2013년 9월 24일
The instructions at http://www.mathworks.com/support/solutions/en/data/1-18I2C/ are either insufficient, incorrect, or I am missing something.
I am running Mac OS 10.8 with 32 GB of memory and I am using MATLAB 2013a.
version -java
gives:
Java 1.6.0_51-b11-457-11M4509 with Apple Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
I noticed that I cannot increase the Java Heap Memory in the Preferences GUI in MATLAB so I followed the instructions at http://www.mathworks.com/support/solutions/en/data/1-18I2C/ and:
1. Created a file using TextEdit.app with one line:
-Xmx7000m
(The instructions gave the example of entering the line -Xmx256m into the java.opts file to increase the max java heap memory to 256 MB. I entered -Xmx7000m to have roughly 7 GB -- which is well under the limit of one quarter of your total memory which, for me, is 0.25*TotalMemory = 0.25*32 GB = 8 GB.)
2. I saved the file as java.opts and chose to "use .opts" file extension when prompted by the Mac OS.
3. I dragged this file from my desktop into the MATLAB_2013a package and entered my password to approve the changes.
4. I restarted the computer and MATLAB.
Still, when I execute
java.lang.Runtime.getRuntime.maxMemory
from the command line I get the same as I did before adding the java.opts file:
200409088
(about 191 MB).
Can anyone provide more accurate instructions or provide a solution that works?
Thank you very much,
Ryan
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!