On 8月21日, 下午11時13分, Stephan Beal <[email protected]> wrote:
> On Fri, Aug 21, 2009 at 3:14 PM, yiufai <[email protected]> wrote:
> > I have an application that using the v8 engine to do embedding.
> > After the execution, I would to clear all memory created by v8 engine
> > itself. How to do that??? (memory leakage detected)
>
> Currently the only way to do this is to call exit() and let the OS kernel
> collect the memory. v8 makes heavy use of static-scope data and does not
> provide a public API which allows one to force a GC run or to completely
> empty out any existing contexts. It cleans up only when/if it decides to
> (and v8 does NOT guaranty that a proper cleanup will happen before v8 shuts
> down, apparently because that impacts Chrome's performance).
>
> --
> ----- stephan bealhttp://wanderinghorse.net/home/stephan/
I also observe from the source code that v8 engine provides a public
API
v8::V8::Dispose() function to tear down the v8 engine permanently. I
think
this function is suitable to me for shutdown the v8 engine in
anplication when
the wrapping javascript service no longer needed. However, I have
tested this
function but some of static global variable which allocated in setup
still does not
free. Is it sometime that i have done wrongly??
Yiu Fai, Cheng
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---