At least to me, not much but i do understand the points of having limits per-object in a vm, but in this case th 77mil elements limit seems ridicously low if you compare to the limit of a typed array like Int32array where you can reach 2^28 elements and use it fully (and sometimes i need to use it fully because of webgl/cl interfacing issues).
I hope, anyhow, that in the near future these limits will be raised a bit :P Il giorno venerdì 12 aprile 2013 18:51:10 UTC+2, Jakob Kummerow ha scritto: > > Makes sense. There's not just a maximum heap size, there are also various > per-object size limits. > > Internal backing stores for dictionaries have a maximum size, effectively > limiting arrays with dictionary mode elements to ~22.3 million elements. We > may (or may not) be able to increase that limit, but it will never > disappear entirely. > When you avoid forcing the array into dictionary mode by not passing such > a huge size to its constructor, you'll notice that you can grow it to about > 77 million elements. As an added benefit, you'll get a significant speedup. > > (For the record, the advice not to pass sizes to Array constructors only > applies to big arrays. For up to several thousand elements, it is (or can > be) beneficial to specify the size, because then V8 will actually > pre-allocate the required space. At some cutoff point, though, the > heuristics will decide that pre-allocation this much space is a bad idea, > so you'll get a dictionary mode array without any pre-allocated backing > store instead.) > > > On Fri, Apr 12, 2013 at 3:16 PM, Francesco Furiani > <[email protected]<javascript:> > > wrote: > >> >> >> Create an Array with lenght 2^28 (that is < 2^32) >> Do a for/while loop to put inside this array some int values (eg the >> value of the counter itself) >> Node crashes around the 20mil element when reaching (according to system >> monitor 1.7/1.8 Gb of RAM) >> >> v8 (3.14.5.8, the one in node 0.10.4), 64bit enviroment, > 16Gb ram, >> --max_old_space_size=16192 on command line >> >> Snippet: >> >> var newFilledArray2 = function(len) { >> var a = new Array(len); >> for(var i = 0; i < len; i++) { >> a[i] = i; >> } >> return a;}; >> var jsArray = newFilledArray(Math.pow(2,28)); >> >> -- >> -- >> v8-users mailing list >> [email protected] <javascript:> >> http://groups.google.com/group/v8-users >> --- >> You received this message because you are subscribed to the Google Groups >> "v8-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
