Java Heap Space Memory Issue

4 次查看(过去 30 天)
Furqan Hashim
Furqan Hashim 2021-1-9
This question has been asked by others as well. But solution in majority of those questions worsened the situtation in my case instaed of improving.
I have a code tha runs a parallel for loop i.e. parfor. In certain cases I get the following error
java.lang.OutOfMemoryError: GC overhead limit exceeded at java.util.Arrays.copyOfRange(Unknown Source) at java.lang.StringBuffer.toString(Unknown Source)
Most of the solution suggested to increase the heap space memory in MATLAB. Once I increased the memory to 2GB from 784MB the frequency at which I was getting this error increased. One thing to note here is that the parallel for loop worked perfectly fine in version 2017b and I started getting this error when I switched to version 2020a. After looking the heap space memory allocated in 2017b I reduced the default memory in 2020a to 384MB similar to default set in 2017b. This solved the issue but I do not understand why reducing helps when most of the solutions suggest to increase the heap space memory.
I want to know a logical reasoning for this behaviour.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by