フィルターのクリア

Memory Management of functions

3 ビュー (過去 30 日間)
Yavuz kaya
Yavuz kaya 2013 年 4 月 15 日
I have a general question about memory management of functions in Matlab.
As far as I know, once the Matlab quits a function, all the memory allocated for that particular function is deallocated from memory.
I have created the following code
while true
a=CalValues;
end
Here is the CalVaues function
%-----
function a=CalValues
a=datestr(now,'yyyymmddHHMMSS');
end
So, basically I am continuously calling a function (a=CalValues) inside a while-loop. After one hour of continuous running the script, I realized that the memory allocated for Matlab is increasing continuously too.
When I break the while-loop with Ctrl+C, then the memory is deallocated. I was wondering Why the memory keep growing in RAM? There is nothing else inside the while-loop.
Is it possible that the Memory is not been deallocated if you call a function inside a while-loop? or till you are really outside of while-loop?
Thanks, Yavyuz
  1 件のコメント
per isakson
per isakson 2013 年 4 月 15 日
編集済み: per isakson 2013 年 4 月 15 日
With R2012a 64bit, Win7
  • Are you seeing an increase of approx. 20KB in Memory(Private working set) of Task Manager?

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeManage Products についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by