How to resolve out of memory error in matlab? Please read details

I am working on an ubuntu system with 24 core workstation. I need to load a large matrix of size (15,9000,100,90). Can any one please help me resolve this error. Do we get this error because of space limitation on matlab or the system? Since my system has enough space, I am still getting this error.

6 Comments

That would take about 9.3 gigabytes, which should be fine with any 64 bit version of MATLAB if there is enough system memory and your process is not being memory limited by a kernel configuration or "limit" command.
Thanks for your response. There is enough memory on the system and it's not memory limited. But simultaneously other simulations are also running on the system which are not in matlab. Do they have any contribution for this error?
Potentially they do, depending on whether your system is set up to allow swap or not.
Thank you. I will read this.

Sign in to comment.

Answers (1)

Type
memory
And check the size of the maximum possible array. An array needs contiguous memory, it's possible yours is fragmented.
If that doesn't help, try
feature('memstats')
(see https://undocumentedmatlab.com/blog/undocumented-feature-function ) Also, look into sparse arrays if the data is sparse (i.e. most elements are 0).

1 Comment

memory() is only valid on MS Windows, but the user is using Linux. The same is true for feature('memstats') -- not available on Mac or Linux.

Sign in to comment.

Categories

Asked:

on 2 Apr 2018

Commented:

on 4 Apr 2018

Community Treasure Hunt

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

Start Hunting!