Status: New
Owner: ----

New issue 256 by sgbeal: Please add a v8-context-is-shutting-down callback  
(or similar)
http://code.google.com/p/v8/issues/detail?id=256

Background:

http://groups.google.com/group/v8-users/browse_thread/thread/c2655be2958b34da#

Very brief summary: the fact that v8 explicitly does not GC during shutdown
leads to blatant leaks when using Persistent handles. One proposed option
was adding an app-maintained list of all allocated native objects, and
clean then up when shutting down the application. This isn't useful for
plugins, however, as the app doesn't know about them and their native
types, so it can't clean them up.

One workaround would be to allow clients to register callback functions
which get called (in reverse order of their insertion) when v8 is closing
down a context. e.g.

typedef void (*ContextShutdownCallback)( Context * cx );

(maybe other parameters are necessary - i'm not sure)

This gives the clients a chance to do such "supplemental" GC themselves.
Without some sort of guaranteed way to clean up native objects, creating v8
wrappers for native classes will always be an exercise in leaking memory.

The *real* solution would be to have v8 always finish its GC, at least for
Pesistent weak pointers (for other JS types a final GC is irrelevant, as
there is no formal destruction process for them).


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to