out of memory error for large data
Afficher commentaires plus anciens
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 commentaires
Chad Greene
le 19 Avr 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
le 19 Avr 2021
Walter Roberson
le 19 Avr 2021
That array is not even 1 gigabyte? It is not clear where the memory problem is coming from?
Georges Murr
le 19 Avr 2021
Clayton Gotberg
le 19 Avr 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
le 19 Avr 2021
Walter Roberson
le 19 Avr 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
le 19 Avr 2021
Réponses (1)
per isakson
le 7 Mai 2021
0 votes
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!