>> it seems gc do not cost that much time, most between 1~3 seconds. Even a 1~3 sec GC pause is a huge one. So it would be great to see detailed statistics produced when --trace-gc --trace-gc-nvp flags are enabled.
>> but i want to known, how these parameters influence gc performance? Well. There is no simple answer because GC behaviour depends on allocation profile of your application. But these parameters only give boundaries for sizes of spaces. V8 chooses actual sizes internally and you can't affect that through API. >> bye the way, memory is not a problem for me? sorry I don't understand this question. Could you please reformulate it? -- Vyacheslav Egorov On Thu, Jul 29, 2010 at 8:12 AM, Jarod <[email protected]> wrote: > sorry, it's my mistake, i add > > void MyGCEpilogueCallback(v8::GCType type, v8::GCCallbackFlags flags) > { > LOG->debug() << "MyGCEpilogueCallback GCType:" << type << ", > GCCallbackFlags:" << flags > << ", cost:" << TC_TimeProvider::getInstance()->getNow() - > g_gc_time << " s" << endl; > } > V8::AddGCEpilogueCallback(MyGCEpilogueCallback); > > it seems gc do not cost that much time, most between 1~3 seconds. > > but i want to known, how > g_ResourceConstraints.set_max_young_space_size(64*1024*1024); > g_ResourceConstraints.set_max_old_space_size(256*1024*1024); > these parameters influence gc performance? > > bye the way, memory is not a problem for me? > > > ------------------ Original ------------------ > *From: * "Vyacheslav Egorov"<[email protected]>; > *Date: * Wed, Jul 28, 2010 03:57 PM > *To: * "v8-users"<[email protected]>; > *Subject: * Re: [v8-users] v8 gc too slow, why? > > Hi, > > It seems that an expensive fullcollection happens there. > > To get a better understanding you should try running your applications with > V8 flags --trace-gc --trace-gc-nvp to see internal GC statistics dumped to > stdout. > > You can use SetFlagsFromString API method to enable these flags > [trace-gc-nvp was introduced recently so it might be unavailable if you use > old version of V8] > > -- > Vyacheslav Egorov > > > On Wed, Jul 28, 2010 at 6:36 AM, shudong ruan <[email protected]>wrote: > >> i do benchmark to v8, and find gc cost too much time: >> >> g_ResourceConstraints.set_max_young_space_size(64*1024*1024); >> >> g_ResourceConstraints.set_max_old_space_size(256*1024*1024); >> SetResourceConstraints(&g_ResourceConstraints); >> >> V8::AddGCPrologueCallback(MyGCPrologueCallback); >> >> void MyGCPrologueCallback(v8::GCType type, v8::GCCallbackFlags flags) >> { >> LOG->debug() << "MyGCPrologueCallback GCType:" << type << ", >> GCCallbackFlags:" << flags << endl; >> } >> >> >> 2010-07-28 11:54:04|17811|DEBUG|v8 HeapStatistics, total size: >> 97435424, used size:37844088, GC ing: 0 >> 2010-07-28 11:54:09|17811|DEBUG|v8 HeapStatistics, total size: >> 97435424, used size:54437608, GC ing: 0 >> 2010-07-28 11:54:11|17797|DEBUG|MyGCPrologueCallback GCType:1, >> GCCallbackFlags:0 >> 2010-07-28 11:54:14|17811|DEBUG|v8 HeapStatistics, total size: >> 97435424, used size:41997672, GC ing: 1 >> 2010-07-28 11:54:19|17811|DEBUG|v8 HeapStatistics, total size: >> 97435424, used size:60070472, GC ing: 1 >> 2010-07-28 11:54:20|17797|DEBUG|MyGCPrologueCallback GCType:1, >> GCCallbackFlags:0 >> 2010-07-28 11:54:24|17811|DEBUG|v8 HeapStatistics, total size: >> 103450112, used size:53090768, GC ing: 1 >> 2010-07-28 11:54:29|17811|DEBUG|v8 HeapStatistics, total size: >> 103450112, used size:68901728, GC ing: 1 >> 2010-07-28 11:54:29|17797|DEBUG|MyGCPrologueCallback GCType:1, >> GCCallbackFlags:0 >> 2010-07-28 11:54:34|17811|DEBUG|v8 HeapStatistics, total size: >> 107260832, used size:58538288, GC ing: 1 >> 2010-07-28 11:54:39|17797|DEBUG|MyGCPrologueCallback GCType:2, >> GCCallbackFlags:0 >> 2010-07-28 11:54:39|17811|DEBUG|v8 HeapStatistics, total size: >> 107260832, used size:73159064, GC ing: 1 >> 2010-07-28 11:54:44|17811|DEBUG|v8 HeapStatistics, total size: >> 110124320, used size:46907488, GC ing: 1 >> 2010-07-28 11:54:49|17811|DEBUG|v8 HeapStatistics, total size: >> 110377280, used size:60930112, GC ing: 1 >> 2010-07-28 11:54:53|17797|DEBUG|MyGCPrologueCallback GCType:1, >> GCCallbackFlags:0 >> 2010-07-28 11:54:54|17811|DEBUG|v8 HeapStatistics, total size: >> 110377280, used size:48738144, GC ing: 1 >> 2010-07-28 11:54:59|17811|DEBUG|v8 HeapStatistics, total size: >> 110377280, used size:65532400, GC ing: 1 >> >> >> every some time, gc cost too much time, and can't do nothing else, >> why? >> >> -- >> 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 > -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
