Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Delete Figure Handle -> Does it clear memory?

Subject: Delete Figure Handle -> Does it clear memory?

From: Jens

Date: 10 Sep, 2012 15:49:08

Message: 1 of 2

Hello,

for my deployed application i have to use my own CloseRequestFcn for some figures.
These figures always have a certain amount of children, for example, menubar, toolbar, uicontrols and so on.

To close the figure i call within my own CloseRequestFcn finally the delete(handles.figure) command. %handles -> Structure of all my gui handles with ancestor is figure!

Does the delete(handles.figure) free up my memory space?
Do i have to call, after the delete(handles.figure) command the clear handles command?

It seems, that after calling the delete command the memory is still reserved and the memory load within my TaskManager does not decrease.

So working with the application increases the memory load steadily.

Subject: Delete Figure Handle -> Does it clear memory?

From: Yair Altman

Date: 11 Sep, 2012 06:50:12

Message: 2 of 2

"Jens" wrote in message <k2l25k$bal$1@newscl01ah.mathworks.com>...
> Hello,
>
> for my deployed application i have to use my own CloseRequestFcn for some figures.
> These figures always have a certain amount of children, for example, menubar, toolbar, uicontrols and so on.
>
> To close the figure i call within my own CloseRequestFcn finally the delete(handles.figure) command. %handles -> Structure of all my gui handles with ancestor is figure!
>
> Does the delete(handles.figure) free up my memory space?
> Do i have to call, after the delete(handles.figure) command the clear handles command?
>
> It seems, that after calling the delete command the memory is still reserved and the memory load within my TaskManager does not decrease.
>
> So working with the application increases the memory load steadily.

Deleting a figure does not really delete it, merely hides the window in such a way that it can no longer be accessible from Matlab, only via Java. This is indeed unfortunate, since it means that as you create/delete figure windows, the resource usage keeps growing.

Yair Altman
http://UndocumentedMatlab.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us