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:
clear all does not clear all memory?

Subject: clear all does not clear all memory?

From: Joao

Date: 4 Dec, 2008 16:44:02

Message: 1 of 4

Hi all,

I've been running some simple, but quite lengthy calculations in Matlab (R14).

In order to save RAM, for each cycle, variables are cleared by a "clear all" command.

But this does not solve everything, since I can tell by the Windows task manager that memory is still taken by Matlab (wich can exceed 1.5 GB) even after my program has crashed or ended, and even if I cleared all variables with a "clear all". Memory is only freed if I shut down matlab and restart it.

Is there any command that really clears all the cache?

Thank you!

 

Subject: clear all does not clear all memory?

From: Praetorian

Date: 4 Dec, 2008 21:33:02

Message: 2 of 4

On Dec 4, 9:44=A0am, "Joao " <joao_ama...@mail.pt> wrote:
> Hi all,
>
> I've been running some simple, but quite lengthy calculations in Matlab (=
R14).
>
> In order to save RAM, for each cycle, variables are cleared by a "clear a=
ll" command.
>
> But this does not solve everything, since I can tell by the Windows task =
manager that memory is still taken by Matlab (wich can exceed 1.5 GB) even =
after my program has crashed or ended, and even if I cleared all variables =
with a "clear all". Memory is only freed if I shut down matlab and restart =
it.
>
> Is there any command that really clears all the cache?
>
> Thank you!

I don't know whether this will fix your problem but you could try
running the PACK command after CLEAR ALL.

HTH,
Ashish.

Subject: clear all does not clear all memory?

From: Joao

Date: 5 Dec, 2008 11:54:02

Message: 3 of 4

Praetorian <ashish.sadanandan@gmail.com> wrote in message <34813a0b-28df-4e25-8a2f-a790fde16603@35g2000pry.googlegroups.com>...
>
> I don't know whether this will fix your problem but you could try
> running the PACK command after CLEAR ALL.
>
> HTH,
> Ashish.

Hi, thanks for the reply.

The pack command did not directly solve the problem, but helped me reach documentation that addresses this.

No real solution, as this seems to be related to Win32 platform memory management. I actually solved this by using the matlab compiler and running the exe file. No more memory problems.

Cheers,
Joao

Subject: clear all does not clear all memory?

From: Chintan

Date: 23 Dec, 2010 12:06:04

Message: 4 of 4

"Joao " <joao_amaral@mail.pt> wrote in message <ghb4op$cd3$1@fred.mathworks.com>...
> Praetorian <ashish.sadanandan@gmail.com> wrote in message <34813a0b-28df-4e25-8a2f-a790fde16603@35g2000pry.googlegroups.com>...
> >
> > I don't know whether this will fix your problem but you could try
> > running the PACK command after CLEAR ALL.
> >
> > HTH,
> > Ashish.
>
> Hi, thanks for the reply.
>
> The pack command did not directly solve the problem, but helped me reach documentation that addresses this.
>
> No real solution, as this seems to be related to Win32 platform memory management. I actually solved this by using the matlab compiler and running the exe file. No more memory problems.
>
> Cheers,
> Joao

Joao,

In your post you mentioned that you were able to solve the issue using the compiler. I would really appreciate if you could provide more details on the same as it will help me in my project.

Thank you and looking forward to your reply.

-Chintan

Tags for this Thread

No tags are associated with 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