Effacer les filtres
Effacer les filtres

memory and time using mat-file

4 vues (au cours des 30 derniers jours)
fcarl
fcarl le 17 Jan 2012
Réponse apportée : Jinal le 23 Juil 2024
hi,
i`ve a question regarding mat-files. I handle a large number of mat-files. Every file is loaded (function load), something is done and then a resulting mat-file is saved. I have two questions:
1) There is a huge difference between "size" and "size on data medium" (e.g. 914 KB to 6.44 MB). What could be reasons for this?
2) The program gets slower and slower in executing all actions for a file. If I erase the resulting files then the program is as fast as at the beginning. So I guess question 1 and 2 are connected in a way I don`t really understand. What is the reason for this?
Thanks for your efforts!

Réponses (1)

Jinal
Jinal le 23 Juil 2024
Hi,
The difference in file size between "size" and "size on data medium" can be due to the way MATLAB stores data in mat-files. When you save a mat-file, MATLAB compresses the data to reduce the file size. However, when you load the mat-file, MATLAB decompresses the data, resulting in a larger size in memory.
The program getting slower and slower could be due to the accumulation of data in memory. As you load and process more mat-files, the memory usage increases leading to slower execution. To address this issue, you can use the `clear` command to remove variables from memory after you are done processing each mat-file.

Catégories

En savoir plus sur Large Files and Big Data dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by