[Lemon-user] "bad alloc" while populating graph

andrea marino andreamarino.it at gmail.com
Thu Jun 7 10:33:46 CEST 2007


Hi,

I'm studying the lemon library, and for my graduation work I've to build the
actor's graph.
Every actor is a node of the graph and two actors are linked if they worked
together.
I made a C++ program to build this graph using the lemon library.
The code will create all the nodes and next will create the edges.
The program work well for a small number of edges, but if I try to load all
the edges in the database I obtain an error of "bal alloc" type when I've
loaded about 33550000 edges.

The strange thing is that I have tried the program in Windows, Linux, MacOSX
and the maximum number of edges loaded is the same...

So I've made, using gdb, a stack trace of the error that I attach.
Why can't I load more edges? Is a bug in my code or a limit of the library?

Thanks,

Andrea Marino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20070607/b0298dd2/attachment.html>
-------------- next part --------------
#0  0xb7d9c847 in raise () from /lib/tls/libc.so.6
#1  0xb7d9e0d9 in abort () from /lib/tls/libc.so.6
#2  0xb7f73c6b in __gnu_cxx::__verbose_terminate_handler ()
   from /usr/lib/libstdc++.so.6
#3  0xb7f718a4 in __cxa_call_unexpected () from /usr/lib/libstdc++.so.6
#4  0xb7f718e1 in std::terminate () from /usr/lib/libstdc++.so.6
#5  0xb7f71a64 in __cxa_throw () from /usr/lib/libstdc++.so.6
#6  0xb7f71cb8 in operator new () from /usr/lib/libstdc++.so.6
#7  0x0804cd29 in __gnu_cxx::new_allocator<lemon::ListGraphBase::EdgeT>::allocate (this=0xbfd63c00, __n=67108864)
    at /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/ext/new_allocator.h:81
#8  0x0804c2f2 in std::_Vector_base<lemon::ListGraphBase::EdgeT, std::allocator<lemon::ListGraphBase::EdgeT> >::_M_allocate (this=0xbfd63c00, __n=67108864)
    at /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:113
#9  0x0804b068 in std::vector<lemon::ListGraphBase::EdgeT, std::allocator<lemon::ListGraphBase::EdgeT> >::_M_insert_aux (this=0xbfd63c00, __position=
      {_M_current = 0x86952008}, __x=@0xbfd63ab0)
    at /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc:244
#10 0x0804a3b5 in std::vector<lemon::ListGraphBase::EdgeT, std::allocator<lemon::ListGraphBase::EdgeT> >::push_back (this=0xbfd63c00, __x=@0xbfd63ab0)
    at /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:564
#11 0x0804a147 in lemon::ListGraphBase::addEdge (this=0xbfd63bec, u=
      {id = 201750}, v={id = 523321})
    at /usr/local/include/lemon/list_graph.h:199
#12 0x0804a0bb in lemon::GraphExtender<lemon::ListGraphBase>::addEdge (
    this=0xbfd63bec, from=@0xbfd63c30, to=@0xbfd63b4c)
    at /usr/local/include/lemon/bits/graph_extender.h:274
#13 0x080498a1 in lemon::ListGraph::addEdge (this=0xbfd63bec, s=@0xbfd63c30, 
    t=@0xbfd63b4c) at /usr/local/include/lemon/list_graph.h:366
#14 0x080490ae in LemonGraph::createEdge (this=0xbfd63be0, from=201750, 
    to=523321)
    at /home/leonardo/upp/Marino/NumericGraphBuilder/LemonGraph.cpp:16
#15 0x080496ab in GraphMaker::start (this=0xbfd63bd0)
    at /home/leonardo/upp/Marino/NumericGraphBuilder/GraphMaker.cpp:117
#16 0x08049190 in main (argc=1, argv=0xbfd63cd4)
    at /home/leonardo/upp/Marino/NumericGraphBuilder/main.cpp:12


More information about the Lemon-user mailing list