Subfunctions seems to keep the memory allocated

Hello.
I was working on a Matlab 2017 on linux. I recently moved to Windows 10 (bad idea) and Matlab 2018 One of my code is not working fine anymore: I call a function in a for loop and at each loop the used amount of memory increases. At the end I get a "OUT OF MEMORY". I use data pre-allocation in the function and the subfunctions except for the variables which are the results of a calculation. If I put a "clearvars -except 'name_of_the_function_output'" in each subfunction, it stop to fail, but of course it is slowlier. It looks like a bug where the memory is not cleared after each function call?
Regards

回答 (1 件)

Baptiste
Baptiste 2018 年 4 月 23 日

0 投票

At the moment the problem seems to be solved without any action: the same code doesn't produce the bug anymore. Possibly a Windows or Matlab update?

カテゴリ

ヘルプ センター および File ExchangeProfile and Improve Performance についてさらに検索

質問済み:

2018 年 4 月 11 日

回答済み:

2018 年 4 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by