Comment 4 for bug 521507

Revision history for this message
Garth Wells (garth-wells) wrote : Re: [Bug 521507] [NEW] Memory leak in Python Expression interface

Johan Hake wrote:
> On Saturday 13 February 2010 13:08:05 Garth Wells wrote:
>> Public bug reported:
>>
>> The below code leads to a memory leak (I see a leak over about 2MB over
>> 90s). The leak is related to the Expression. If I comment out the call
>> to
>>
>> eval(Array<double>&, const Array<double>&);
>>
>> from
>>
>> dolfin::GenericFunction::evaluate(double*, const double*, const
>> ufc::cell) const
>>
>> I don't detect a leak.
>
> I can confirm this bug. Not sure it is in the typemap, as it should also have
> shown up if we moved f = MyExpression(degree=1) outside of the loop.
>

I've add some scripts for testing memory to

  lp:~dolfin-core/dolfin/sandbox

under 'memtest'.

I'm seeing a case where a call-back from C++ to a Python sublass of
NonlinearProblem is causing a big leak.

Garth

> Johan
>