On Thu, Jun 27, 2013 at 3:52 PM, Lew Janyu <[email protected]> wrote: > Please view the code below: > > // d8 --expose-gc > > for(var i = 0; i < 1000000; i++) > { > // allocation huge memory > var buffer = []; > buffer.length = 100000; > // assign to some native function's prototype > version.prototype[i] = buffer; > } > // clean the function to dereference the buffers > version = undefined; > // force gc > gc(); > > print("gc was done, but the memory footprint is still huge. why?"); > // pause > for(;;);
Calling gc() doesn't guarantee that V8 will collect all garbage. It generally performs just enough collection to get by (something of a simplification but approximately correct.) By the way, you mention 'memory footprint' but not if that means RSS or VSZ. -- -- 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.
