Comment #3 on issue 3523 by [email protected]: Deadlock after calling
IdleNotification(100) or Dispose on isolate
http://code.google.com/p/v8/issues/detail?id=3523
Garbage collection doesn't "get rid of memory leaks". A "leak" is when, for
whatever reason, the garbage collector fails to free memory.
As #1 described, you can get leaks by holding on to objects, keeping them
live (a.k.a. "reachable"). Persistent handles on the C++ side are one way
to do that. Reachable JavaScript objects are another. For example, "var a =
[]; while (true) { a = [1, 2, a]; }" will go out of memory, because all
objects are still reachable, so the garbage collector can't free any
memory, no matter how hard it tries.
Relying on weak callbacks to get called is a bad idea. Don't do it. (This
is unrelated to V8; the whole concept of finalization in garbage-collected
systems just doesn't work.)
Valgrind can't inspect the V8 heap, which is managed by the garbage
collector. If Valgrind reports leaks, the garbage collector is not your
problem, and there's nothing it can possibly do to fix your problem. AFAIK
our d8 shell is valgrind-clean, so that would be an example for a fairly
complex leak-free embedder.
Of course the garbage collector runs automatically, that's the whole point.
But it's not run on program termination (or isolate disposal), because that
would be a waste of time.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" 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/d/optout.