Large Memory Usage When Accessing .mat File

조회 수: 14 (최근 30일)
Mike
Mike 2015년 9월 16일
댓글: Maximilian Appel 2017년 6월 21일
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
Mike
Mike 2015년 9월 16일
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 2017년 6월 21일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by