Freeing up memory occupied by mex ?

Rishi Amrit rishiamrit at gmail.com
Wed Jan 21 11:20:33 CST 2009


On Wed, Jan 21, 2009 at 9:41 AM, John W. Eaton <jwe at octave.org> wrote:

> The code in Octave that calls mex functions should free all memory
> allocated with the mex/mx functions on exit.  Are you sure that the
> leak is not in the ipopt code itself?
>
> After calling ipopt, what happens if you clear all variables in the
> workspace?


I ran a test. When I start octave, it starts using 30 Megs of RAM. After the
end of ipopt call, memory usage by octave is 600 MB. Clearing all the
variables with 'clear all' clears the workspace but does'nt flush the memory
and octave still uses 600 MB's. So definitely the workspace variables are
not using all that memory. Does that indicate a memory leak in ipopt code ?
I should also mention, ipopt is also calling sundials toolboox for gradient
estimation, which also is a mex call. Sundials has a CVodefree function that
is supposed to clear memory used by CVode function, and I am using that
function appropriately. So the possibility of Sundials being the culprit is
probably less.

Thanks,

Rishi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090121/7b52f160/attachment.html 


More information about the Help-octave mailing list