Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2006-04-10 16:08:06


On Mar 15, 2006, at 9:25 PM, Olivier Delalleau wrote:

> I am constructing a graph exactly the same way as in the spanning tree
> example here:
> http://www.boost.org/libs/graph/example/prim-example.cpp
> i.e. using a constructor of the kind
> Graph g(edges, edges + sizeof(edges) / sizeof(E), weights,
> num_nodes);
> where Graph is some kind of adjacency_list.
> In my application, edges is rather big (on the order of 1e7 elements).
>
> Problem: when this constructor is called, it allocates a huge
> amount of
> memory (I see this when I do a 'top' to monitor the memory usage while
> in gdb). And this memory is not freed when the graph is deleted
> (when it
> gets out of the scope, or, if I use a pointer instead, when I
> delete it
> explicitely).
> Is there a way to recover this memory? Any hint on how to make it use
> less memory?

If it's true that we're not deallocating memory properly in the graph
data structure, it's a critical bug that we absolutely must fix.
"top", however, isn't useful for determining if there is a memory leak.

        Doug


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net