フィルターのクリア

Possible memory leak with "matfile"? (R2016b)

1 回表示 (過去 30 日間)
Anthony Barone
Anthony Barone 2017 年 3 月 9 日
編集済み: Pingmin Fenlly Liu 2017 年 11 月 7 日
I'm running a code where the results I am generating are saved to disk using matfile. It is running on matlab R2016b on a Linux system. I initially (before running the code) created a v7.3 .mat file that contained variables for all of my results, and each variable is filled with just zeros. At the start of the code I then used the "matfile" command to make a "matOBJ" of this .mat file, and am filling in results as they are generated (the code I am running involves looping over several different locations and generating a result for each location).
Since I have started running the code, the "top" and "free" commands (this is on a linux system) have show a gradual increase in total system memory. There is no one else using the system for anything, so I have to believe that matlab is the culprit.
Running "top" seems to indicate that matlab should only be using ~6-8 GB. When I started, non-matlab stuff was using about 5 GB of RAM, so I would expect total memory usage to remain at a constant ~11-13 GB (this system has 32 GB available). Instead, memory usage has slowly crept up to ~24 GB, and appears to be continuing to rise. In the past I have experienced a similiar issue when using memmapfile, making me think the matfile was the culprit. When this happened with memmapfile, the issue seemed to be that when any part of the mapped file was access, it was loaded into memory and it never was cleared after that part was no longer needed. This type of behavior would explain the gradual increase in memory usage I am seeing.
Has anyone else experienced this issue? Any suggestions on how to avoid it? Anything I need to add to my code when using matfile to ensure that parts I no longer need are cleared from memory?
  1 件のコメント
Pingmin Fenlly Liu
Pingmin Fenlly Liu 2017 年 11 月 7 日
編集済み: Pingmin Fenlly Liu 2017 年 11 月 7 日
Yes, we got the memory related issue in R2016b too!
See also matlab 2016a (linux) memory leak for more info.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangePerformance and Memory についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by