[Graph] Python BGL memory leak (or not...)
Hi, It seems I'm having a memory leak after calling dijkstra_shortest_paths several times. Either I'm wrong, or the predecessor_map is not being deleted. The call I have is something like this: p = self.graph.vertex_property_map('vertex') boost.dijkstra_shortest_paths(self.graph, self.vertexes[src], predecessor_map = p, weight_map = self.weights) Then I manipulate p to get the shortest_path between two points, and exit the function. Still, even after a gc.collect(), the memory keeps getting bigger (and because my graph has about 1 million vertexes, it gets REALLY bigger). Any thoughts on how to force the memory allocation for the predecessor_map? Thanks in advance, Hugo Ferreira -- GPG Fingerprint: B0D7 1249 447D F5BB 22C5 5B9B 078C 2615 504B 7B85
On Dec 6, 2006, at 10:12 AM, Hugo Ferreira wrote:
It seems I'm having a memory leak after calling dijkstra_shortest_paths several times. Either I'm wrong, or the predecessor_map is not being deleted. The call I have is something like this:
p = self.graph.vertex_property_map('vertex') boost.dijkstra_shortest_paths(self.graph, self.vertexes[src], predecessor_map = p, weight_map = self.weights)
Then I manipulate p to get the shortest_path between two points, and exit the function. Still, even after a gc.collect(), the memory keeps getting bigger (and because my graph has about 1 million vertexes, it gets REALLY bigger).
Any thoughts on how to force the memory allocation for the predecessor_map?
This is a bug in the BGL-Python bindings, where the graph type holds on to a copy of all of its property map. I believe that I have now fixed the problem in Subversion. Cheers, Doug
participants (2)
-
Douglas Gregor
-
Hugo Ferreira