how to specify java heap size on cluster?

I am trying to run matlab on a cluster. I need to increase the java heap size in matlab, but since it's a cluster, I can't use the GUI method to do this. Is there a command line flag to specify the java heap size on start-up? Something like matlab -nosplash - Xmx.... Or, is there a start-up options file on the cluster that I can edit? I have read about editing the java.opts file or the startup.m file, but it seems like these would not be allowed on a cluster.

回答 (1 件)

Abel Szkalisity
Abel Szkalisity 2021 年 2 月 6 日

2 投票

But honeslty, to me none of the answers suggested there solved my problem (namely to increase the java-heap size on the cluster).
It turned out (at least the experience shows), that the environment variable _JAVA_OPTIONS is overriding the settings both in java.opts and in the matlab.prf file. On linux try sg like:
export _JAVA_OPTIONS=-Xmx2048m
in your command line before starting matlab to increase the heap space. This worked for me on R2019a in a linux cluster.

4 件のコメント

Saadia Karim
Saadia Karim 2021 年 6 月 21 日
What about Windows 10 Matlab R2020a. I am facing jave heap memory issue.
Walter Roberson
Walter Roberson 2021 年 6 月 21 日
@Saadia Karim is that a Windows 10 cluster? Or is that a Windows 10 desktop MATLAB use?
Saadia Karim
Saadia Karim 2021 年 6 月 26 日
i found the solution for the Java Heap Memory by installing Java SE Runtime Environment Latest verison (java_8u291)and increase the parameter to 4Gb using -Xmx4096m in Runtime parameter tab. and this help in not only in Matlab R2020a but also in other application too.
Martin Lechner
Martin Lechner 2023 年 6 月 21 日
This solution works perfectly for my standalone Matlab applications on Linux calculation clusters.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

タグ

質問済み:

2016 年 8 月 18 日

コメント済み:

2023 年 6 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by