Unload matrix and free memory

前端 未结 3 1167
悲&欢浪女
悲&欢浪女 2021-01-14 10:14

I can load a matrix from text file:

load mydata.txt

The problem is my matrix file is about 250Mb and after several such loads I have no mem

3条回答
  •  無奈伤痛
    2021-01-14 10:47

    What you have to do clear mydata and then issue pack . The first command says to Matlab that the reference to the memory held for mydata is not needed anymore. The second command instruct the Matlab to free unused memory. If you don't issue pack, then memory will be deallocated when the Matlab memory manager decides to.

提交回复
热议问题