[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Freeing up memory occupied by mex ?
From: |
John W. Eaton |
Subject: |
Re: Freeing up memory occupied by mex ? |
Date: |
Thu, 22 Jan 2009 15:06:35 -0500 |
On 21-Jan-2009, Rishi Amrit wrote:
| On Wed, Jan 21, 2009 at 9:41 AM, John W. Eaton <address@hidden> 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.
How do you know that CVodefree is really freeing all the memory
allocated? Maybe there is a bug there? Or in ipopt?
If you think this is a bug in Octave, then please submit a complete
bug report to the address@hidden list.
Can you produce a small self-contained example (not relying on ipopt
or sundials) that shows that Octave's mex interface can result in
memory leaks?
What version of Octave are you using?
jwe