Mesh.coordinates might lead to memory leakage in Python interface
Bug #982854 reported by
Johan Hake
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
New
|
Undecided
|
Johan Hake |
Bug Description
When returning the coordinates from a Mesh in the Python interface a reference to the Mesh is stored kept in the NumPy array, keeping the Mesh in scope as long as the coordinate array lives. This might lead to memory leakage as the Mesh contains much larger memory structures than the coordinate vector.
In discussion of:
https:/
a solution was scetched, where the coordinates are stored as a shared_
Changed in dolfin: | |
milestone: | none → trunk |
assignee: | nobody → Johan Hake (johan-hake) |
To post a comment you must log in.
Is it really memory leakage? The memory will be freed when the array
goes out of scope.
--
Anders
On Mon, Apr 16, 2012 at 08:02:57AM -0000, Johan Hake wrote: /bugs.launchpad .net/dolfin/ +bug/966553 ptr<std: :vector< double> >. Then we implement a shared_ptr version
> Public bug reported:
>
> When returning the coordinates from a Mesh in the Python interface a
> reference to the Mesh is stored kept in the NumPy array, keeping the
> Mesh in scope as long as the coordinate array lives. This might lead to
> memory leakage as the Mesh contains much larger memory structures than
> the coordinate vector.
>
> In discussion of:
>
> https:/
>
> a solution was scetched, where the coordinates are stored as a
> shared_
> of Mesh::coordinates and store this object to the NumPy array instead.
>
> ** Affects: dolfin
> Importance: Undecided
> Assignee: Johan Hake (johan-hake)
> Status: New
>
> ** Changed in: dolfin
> Milestone: None => trunk
>
> ** Changed in: dolfin
> Assignee: (unassigned) => Johan Hake (johan-hake)
>