Large Memory Usage When Accessing .mat File

16 Ansichten (letzte 30 Tage)
Mike
Mike am 16 Sep. 2015
Kommentiert: Maximilian Appel am 21 Jun. 2017
I'm running MATLAB 2012b on a Windows 7 desktop with 16 GB of RAM. I have a .mat file that is 12.3 MB in size. I run the whos('-file', filename) to examine the contents of the file. Prior to running the command, here is the output of the memory command:
Maximum possible array: 24509 MB (2.570e+10 bytes) *
Memory available for all arrays: 24509 MB (2.570e+10 bytes) *
Memory used by MATLAB: 6421 MB (6.733e+09 bytes)
Physical Memory (RAM): 16310 MB (1.710e+10 bytes)
Here is the output from memory after running the command:
Maximum possible array: 22692 MB (2.379e+10 bytes) *
Memory available for all arrays: 22692 MB (2.379e+10 bytes) *
Memory used by MATLAB: 8215 MB (8.615e+09 bytes)
Physical Memory (RAM): 16310 MB (1.710e+10 bytes)
Why does running whos on a 12.3 MB file use nearly 2000 MB of memory? Is it possible to free that memory?
I see a similar problem when I call open or load for the file. I can clear the variable returned from either command, but the memory is never free'd.
  3 Kommentare
Mike
Mike am 16 Sep. 2015
Loading then saving does not seem to help.
I might add that this is one of many files I am trying to process in a script. I load each file, do some processing, then continue. The load and open functions seem to have the same type of behavior as whos. When I load or open a file, the memory is used and never gets free'd. Eventually, the process uses up all the memory on my machine, and MATLAB dies.
Maximilian Appel
Maximilian Appel am 21 Jun. 2017
Same here, R2016b allocates 2.3TB of memory to load a 500mb .mat v7.3 file. So the process is killed and I will not be able to use my simulation results, yippee.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by