How To Empty Ram With Mel

Hey,

I'm wondering if there's a way to clear ram in maya using a mel command

thanks

Nicola

sure:

CODE
file -f -new;

no. Pardon me. ;] But what do you want to do?
I mean.. you could avoid creating global vars and perform CODE
clear $array;
on unused arrays.. but that shouldn't carry much weight.

well, the problem is that I'm doing some renders and some data remains in ram after computation. for example
I open maya with this scene and the task manager says that I'm using 900 Mb of ram, then I render a frame
in the render view window and my ram grow up to 1.3 gb, then every time a render a frame the ram grow up and then maya crash when I reach the limit... so every 3-4 render I have to close maya and open the scene again...that's the problem...

what does the taskmanager say if you minimize Maya after rendering?

Your supposed to launch renders as batch renders thet dont share the maya. Besides your supposed to launch them on a seond computer also

even if I use batchrender ram will grow up until cpu crash, the only way to batchrender is to make one frame for each process, so if I need to render 30 frames I need to make a bat files with 30 lines and 30 render.exe command...

maybe I can append a command that empty unused ram after every frame rendered...

nicola

Well leaks are not really possible to totally avoid (especially because maya is a functional programming language and you may do what you wish, even not so smart things) thats why even big things like pixar launch each rendered sub frame as a separate render launch. Thats the job of their queue mangers to handle.

You could run the batch without maya running to save some 500 megs of memory.

Anyway what i would do is export things one by one untill i find the leak to fix it but most likely id just force it out. Or bake the rig down and watch if that fixes it.

QUOTE
so if I need to render 30 frames I need to make a bat files with 30 lines and 30 render.exe command...

ever heard of a loop? For example in windows shell it would look like this:

FOR /L %i IN (1,1,30) DO render -s %i -e %i yadayada....

All shells have a for constructor just for stuff like this. please note if you make a bat file the %i should be renamed into %%i

It is quite common to launch renders in small chunks just so even if maya crashes it will do something most of the night. For example im rendering with a program that cheeks every so and so intervals if a frames been made and kills any running process if not just in case it has locked up and relaunches any unsuccessful frames. The time is based on my judgment of a top cap for the individual render and it spans form 10-240 minutes usually.

This lets me go away amd not supervise stuff so closely. And it will keep me up to date online so i can chek the status even on my mobile.
QUOTE
maybe I can append a command that empty unused ram after every frame rendered...

No the exact nature of a data leak means that its not known what made it thus theres no way of knowing what to clear, so the options are to keep it or clear EVERYTHING including maya.

Thet is to say if you KNEW what leaked the memory you wouldnt be doing it.