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

Alpár Jüttner alpar at cs.elte.hu
Thu Jun 7 15:27:41 CEST 2007


Hi,

ListGraph uses an std::vector<> to store the edge descriptors.
As far as we see now, the problem is not in LEMON but in STL itself. For
example: the following code also aborts at i=33554432:

class C { int a1,a2,a3,a4,a5,a6; };
int main()
{
  std::vector<C> v;
  for(int i=0;i<40000000;i++) v.push_back(C());
}

Note that 

std::vector<C> v(40000000);

works perfectly.

We are going to find some workaround. Untill then, try to use a 64bit
architecture. This bug will not appear there.
 
Alpar

On Thu, 2007-06-07 at 14:14 +0200, andrea marino wrote:
>         At most time we use vectors for storages which can double the
>         necessary space
>         of the graphs and maps. So I suggest to make a short
>         estimation about the 
>         space requirements.
>  
> I tried with systems of different memory size (512MB RAM and 1024
> Swap, 1024 RAM and 1024 Swap, 1536 MB and 1024 Swap) and the maximum
> number of edges which I can load is the same. So I think that it's not
> a free space issue.
>  
> According to your estimation of the graph size my graph will take
> something like 1024 MB of memory...
>  
> Thanks,
>  
> Andrea Marino
>  
>  
> 
>  
>  
> 
>  
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user




More information about the Lemon-user mailing list