On Tue, Dec 13, 2016 at 3:15 AM, Jane Chen <jxche...@gmail.com> wrote:
> Related to this thread:
>
>   https://groups.google.com/forum/#!topic/v8-users/deYE9pzK9b8
>
> I am having some difficulty with garbage collection in v8 5.3.  As a result,
> I do the following after running a JavaScript request:
>
> 1) ContextDisposedNotification
> 2) IdleNotificationDeadline
> 3) If uncollected references still exist, LowMemoryNotification
> 4) If uncollected references still exist, reset them in my code, then
> dispose the isolate.
>
> Although this avoids a crash or memory corruption most of the time, I get a
> memory leak and eventually run out of memory.
>
> The way I dispose an isolate is just by calling Isolate::Dispose().  Am I
> missing anything?
>
> Conceptually, is the memory allocated and consumed in an isolate completely
> freed when the isolate is disposed?  Even when garbage collection is
> incomplete in that isolate?
>
> Thanks in advance.

It should release all resources, yes.  I was looking into
multi-isolate support in node.js a while ago and I didn't notice any
memory leaks with 5.3 (IIRC, it might also have been 5.1.)

Have you run your application through valgrind?  Is it possible it's
memory fragmentation instead of a memory leak?

If you have multiple isolates making interleaved allocations, it's
possible the address space fragments too much for a new isolate to
reserve a sufficiently large chunk, even if some of the older isolates
have been disposed of.

That's normally only a problem with 32 bits builds although 64 bits
Solaris/Illumos can be pretty terrible too.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to