Hi Mads, Thanks for your clear explanation. Your response is quite helpful to me.
Best Regards, Kenny 2011/1/12 Mads Sig Ager <[email protected]> > Hi Kenny, > > I think there are two different issues here. One is speedups because of the > Crankshaft adaptive compilation infrastructure which is what is in V8 3.0. > The other is the removal of GC in connection with context disposals which > happened before V8 3.0 and is completely independent. > > We used to force a garbage collection on context *creation* if a context > had been disposed since the last GC. This is bad for app startup performance > because (in the browser) that means that you get the GC during page load. > The mechanism that we use now is to notify V8 of context disposals and use > idle notifications to clean up after context disposals. If you notify V8 of > context disposals and then decide when to call IdleNotification (when your > app is believed to be idle so it does not interfere too much with other > operations) I think that will help with memory consumption. For the approach > currently used in Chrome have a look at this webkit patch: > https://bugs.webkit.org/attachment.cgi?id=49797&action=diff > > Thanks, -- Mads > > On Tue, Jan 11, 2011 at 4:38 PM, hua ye <[email protected]> wrote: > >> Hi guys, >> >> Recently, I am comparing the performance of v83.0 and the old versions. >> >> I found that 3.0 has great improvement in the speed of running script. >> But, the memory usage keeps high. >> We use V8 as the engine to run script content in html pages. We also have >> the binding of DOM objec like what is done in Chrome. A v8 context is >> created when processing a HTML page and disposed at finishing. Then, a new >> HTML page comes, a new context created.... >> >> 3.0 has an impressive speed in run scripts, but it used much memory than >> 2.0. And the memory usage keeps increasing. >> I noticed that v3.0 removed GC from Context::New(), it may be the primary >> reason of speed enhance. >> >> Then, my question is: >> >> In 3.0, when will v8 performe GC? Should the caller invoke GC explicitly >> like call v8::V8::LowMemoryNotification()? >> I have tried this, but the speed then decreases dramaticlly. You know that >> is not what I want. >> >> Is there any idea to keep the super speed of new V8 and at the same we can >> control the memory usage? >> >> Best Regards, >> Kenny >> >> >> >> >> -- >> v8-users mailing list >> [email protected] >> http://groups.google.com/group/v8-users > > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
