out of memory error for large data
Show older comments
I am working with a 50000*2048 matrix, but I want to do the simulation only once and save the data in a h5 file, unfortunately I am having memory problems and I can't save or load the data from the h5 file. Is there any solution to store large data ?
9 Comments
Chad Greene
on 19 Apr 2021
Is it possible to do your processing in tiles, or do you need to operate on the entire matrix at once? For example, you could break it up into 50 1000*2048 matrices and load only the sections you need by specifiying the start and stride in h5read.
Georges Murr
on 19 Apr 2021
Walter Roberson
on 19 Apr 2021
That array is not even 1 gigabyte? It is not clear where the memory problem is coming from?
Georges Murr
on 19 Apr 2021
Clayton Gotberg
on 19 Apr 2021
It doesn't seem like you'd need the entire matrix for abs()^2. The only way those operations make sense are if they're performed elementwise (since, your matrix isn't square, the ^2 operation isn't well-defined as matrix multiplication). However, you might see if tall arrays solve your memory trouble satisfactorily - you'll just need to make sure all of the functions you use in MATLAB as compatible.
50 * 1000 * 2048 * 8
ans / 10^9
Not even 1 gigabyte. Not unless your matrices are complex-valued or are not numeric.
Georges Murr
on 19 Apr 2021
Walter Roberson
on 19 Apr 2021
Okay, so double the storage for complex, still gets you 1.7 gigabytes at most. That would not be a problem unless you have quite a small memory (such as 4 gigabytes)
Georges Murr
on 19 Apr 2021
Answers (1)
per isakson
on 7 May 2021
0 votes
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!