필터 지우기
필터 지우기

memory lost with a simple code

조회 수: 2 (최근 30일)
Nikolay Vinnichenko
Nikolay Vinnichenko 2020년 1월 5일
Hello!
I was trying to optimize my image-processing software to make it use less memory and was very surprised to see that the very first function, which simply requests the user to specify a folder, writes it to file, then displays its path in a text element and makes two more text elements invisible, - results in decrease of the memory available for all arrays by 33 Mb! Where are they gone?
Here is the function code:
function SetCurrDir
global currdirpath hTxtCurrDir hTxtProcessDisplDone hTxtProcessContinueDone
currdirpath=uigetdir;
fid1=fopen('CurrDir.txt', 'wt');
fprintf(fid1, '%s', currdirpath);
fclose(fid1);
set(hTxtCurrDir, 'String', {'Current directory is', currdirpath}, 'Visible', 'on');
set(hTxtProcessDisplDone, 'Visible', 'off');
set(hTxtProcessContinueDone, 'Visible', 'off');
clear fid1;
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by