[pgrouting-users] PostGIS - Problem with driving_distance
segfault when calculating distance for many nodes
Daniel Kastl
daniel at georepublic.de
Tue Aug 30 22:41:21 EDT 2011
Hi Kurt,
Thank you for reporting this issue!
Without being able to answer your questions about the memory allocation, I
would like to point you to some new algorithms developed during the Google
Summer of Code program this year.
Jay as well as Kishore (our sutedents) have added an
"All-Pair-Shortest-Path" (APSP) function, that can calculate a distance
matrix. Doing many shortest path queries is inefficient, because for every
query it selects the network into the memory again and again. APSP should do
this only once, which should also solve the memory issue.
Currently Jay's and Kishore's code resides in different branches of the
Github repository. And you would have to take the role as a "beta-tester"
;-)
Though if you often need to calculate a distance matrix then it might be
worth to try. Of course your feedback would be very welcome!
Here a few links if you want to take a look.
- https://github.com/pgRouting/pgrouting/network
look for branch "gsoc-tdsp" and "apsp-johnson"
- https://github.com/pgRouting/pgrouting/wiki/APSP
This document should be for APSP in the "gsoc-tdsp" branch. Jay, can you
confirm this? Is the document still valid?
Best regards,
Daniel
On Wed, Aug 31, 2011 at 4:04 AM, Weninger Kurt <kurt.weninger at utanet.at>wrote:
> Hi !
>
> I am calculating the shortest paths for some nodes of a large network with
> about 600.000 nodes and edges. Building network topology works fine, also
> computing the distance for one node.
> The problem I am encountering occurs when I am trying to calculate the
> shortest path matrix for several selected nodes (about 1000) at once. I am
> calling the function for each node and as I also have reverse costs are
> getting the resulting matrix.
> Problem is that I get a segfault in librouting_dd.so after ~ 170 nodes in
> Windows and ~ 300 nodes in Linux. The backtrace leads me to line 162 of
> boost_drivedist.cpp.
> When I am doing the calculation in pieces of 100 nodes and logging out
> between calculations everything works fine.
>
> I think the problem is using malloc to reserve memory, as I observed
> increasing memory usage of process postgres.
>
> *path = (path_element_t *) malloc( sizeof(path_element_t) *
> (path_vector.size() + 1) );
>
> It seems to me the memory is never freed.
> Can this be solved using palloc ? And how ? Because I tried changing
> malloc to palloc, but getting strange errors in other libraries
> afterwards.
>
> Thanks for your help,
>
> Kurt
>
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20110831/4948c7f5/attachment.html
More information about the Pgrouting-users
mailing list