Re: [Vala] Gee LinkedList Problem : Memory allocation fails when list size > 1000000



On 06/14/2011 02:30 AM, Serge Hulne wrote:
Example:

NB : The example hereunder works perfectly with a number of elements<=
100,000 but crashes if one when the number of elements to insert in the List
is>= 1000,000 .


     var L = new LinkedList<pair?>( (EqualFunc) equals);

     // Insert in List (to sort)
     pair p = pair();
     for (var i=0; i<1000000; i++) {
         p.word = "test";
         p.freq = 1;
         L.add(p);

does not fail on my box.  are you running out of memory?

[08:51:47] rthompso raker>~
$ ./linkfail
(1,      'test')
(1,      'test')
(1,      'test')
(1,      'test')
(1,      'test')
(1,      'test')
(1,      'test')
(1,      'test')
(1,      'test')
(1,      'test')
(1,      'test')

[08:52:01] rthompso raker>~
$ grep var linkedFailure.vala
    var L = new LinkedList<pair?>( (EqualFunc) equals);
    for (var i=0; i<5000000; i++) {
    var i = 0;
    foreach (var item in L) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]