matlab disk space and memory issues
Afficher commentaires plus anciens
I am running a script that is formatting some data for use in a machine learning/classification system. However when running it MATLAB ends up using 100% of disk space and up to 80% of memory.
Even when I temporarily pause the script matlab is still using a good 50-60% of memory. This is even after waiting for several minutes after pausing the script.
Any way I can stop matlab needlessly using so much memory and hard disk space? Seems to me that it should not be doing this when an application is paused, though perhaps I am mistaken since my script initializes a 8192x140,000 matrix of zeroes and then replaces each column with new data.
Many thanks
Regards R
5 commentaires
Dennis
le 21 Juin 2018
I think that Matrix has a size of almost 9 GB, depending on the size of your RAM it might not fit in. I do not know why it should take alot of disk space though.
cnfan_sd70
le 21 Juin 2018
Steven Lord
le 21 Juin 2018
Is it possibly the fact that I am looping round 140,000 times to iterate through some data, to then format the iterated section and then deposit it in the appropriate column of my matrix?
It could be. Without seeing code it's very difficult to say. Assuming your matrix is a full real double matrix of size [8192 140000] allocating (potentially multiple copies of) a roughly eight and a half GB matrix is also a strong candidate for why your code uses so much memory.
I do know that loops are not great in matlab
That's not really true anymore. We've done a lot of work over the past 15-20 years to improve the performance of MATLAB, including improving the performance of loops. It's possible to write fast code that uses loops, slow code that uses loops, fast vectorized code, or slow vectorized code.
cnfan_sd70
le 21 Juin 2018
cnfan_sd70
le 21 Juin 2018
Réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!