I modify the source of test_shell to execute my benchmark, each url open a 
webframe, and after 2 minutes i close the expired webframe.
 I start a new thread which send a heartbeat request to message_loop, when i 
find long time this heartbeat not executed, then i call 
V8::TerminateExecution() (when v8 do gc, i will not call V8::TerminateExecution)
 And i find too question:
 1 Every few minutes, gc will cost much time, almost about 1~10 seconds
 2 test_shell will be coredump now and then, it seems most core dump happened 
after gc(MyGCEpilogueCallback)
  
 ================================================
  >> bye the way, memory is not a problem for me? 
 
 

 sorry I don't understand this question. Could you please reformulate it? 
  
 my compute has 16GB memory, so i don't care memory cost.

  
 #0  0x00007fa18acccc01 in WTF::HashTable<v8::Value*, std::pair<v8::Value*, 
WebCore::GlobalHandleInfo*>, WTF::PairFirstExtractor<std::pair<v8::Value*, 
WebCore::GlobalHandleInfo*> >, WTF::PtrHash<v8::Value*>, 
WTF::PairHashTraits<WTF::HashTraits<v8::Value*>, 
WTF::HashTraits<WebCore::GlobalHandleInfo*> >, WTF::HashTraits<v8::Value*> 
>::checkKey<v8::Value*, WTF::IdentityHashTranslator<v8::Value*, 
std::pair<v8::Value*, WebCore::GlobalHandleInfo*>, WTF::PtrHash<v8::Value*> > > 
(this=<value optimized out>, k...@0x7fff3dd567e8) at 
third_party/WebKit/JavaScriptCore/wtf/HashTable.h:465
#1  0x00007fa18accb7ca in lookup<v8::Value*, 
WTF::IdentityHashTranslator<v8::Value*, std::pair<v8::Value*, 
WebCore::GlobalHandleInfo*>, WTF::PtrHash<v8::Value*> > > (key=<value optimized 
out>, this=<value optimized out>) at 
third_party/WebKit/JavaScriptCore/wtf/HashTable.h:479
#2  contains<v8::Value*, WTF::IdentityHashTranslator<v8::Value*, 
std::pair<v8::Value*, WebCore::GlobalHandleInfo*>, WTF::PtrHash<v8::Value*> > > 
(
    key=<value optimized out>, this=<value optimized out>) at 
third_party/WebKit/JavaScriptCore/wtf/HashTable.h:804
#3  contains (key=<value optimized out>, this=<value optimized out>) at 
third_party/WebKit/JavaScriptCore/wtf/HashTable.h:327
#4  contains (key=<value optimized out>, this=<value optimized out>) at 
third_party/WebKit/JavaScriptCore/wtf/HashMap.h:206
#5  WebCore::V8GCController::registerGlobalHandle (key=<value optimized out>, 
this=<value optimized out>)
    at third_party/WebKit/WebCore/bindings/v8/V8GCController.cpp:100
#6  0x00007fa18acc5d03 in WebCore::V8DOMWindowShell::updateDocumentWrapperCache 
(this=0x7fa145e7fee0)
    at third_party/WebKit/WebCore/bindings/v8/V8DOMWindowShell.cpp:432
#7  0x00007fa18acc74d2 in WebCore::V8DOMWindowShell::updateDocument 
(this=0x7fa145e7fee0)
    at third_party/WebKit/WebCore/bindings/v8/V8DOMWindowShell.cpp:506
#8  0x00007fa18acc7040 in WebCore::V8DOMWindowShell::initContextIfNeeded 
(this=0x7fa145e7fee0)
    at third_party/WebKit/WebCore/bindings/v8/V8DOMWindowShell.cpp:300
#9  0x00007fa18acd91bd in WebCore::V8Proxy::mainWorldContext 
(this=0x7fa145ea7780) at third_party/WebKit/WebCore/bindings/v8/V8Proxy.cpp:776
#10 0x00007fa18acd91fb in WebCore::V8Proxy::mainWorldContext (frame=<value 
optimized out>) at third_party/WebKit/WebCore/bindings/v8/V8Proxy.cpp:786
#11 0x00007fa18acaefa7 in WebCore::ScriptController::evaluate 
(this=0x7fa145eac938, sourceCode=..., shouldAllowXSS=<value optimized out>)
    at third_party/WebKit/WebCore/bindings/v8/ScriptController.cpp:230
#12 0x00007fa18ac660df in WebCore::ScriptController::executeScript 
(this=0x7fa145eac938, sourceCode=..., shouldAllowXSS=DoNotAllowXSS)
    at third_party/WebKit/WebCore/bindings/ScriptControllerBase.cpp:60
#13 0x00007fa18b021e54 in WebCore::LegacyHTMLDocumentParser::scriptExecution 
(this=0x7fa145e89800, sourceCode=..., state=<value optimized out>)
    at third_party/WebKit/WebCore/html/LegacyHTMLDocumentParser.cpp:557
#14 0x00007fa18b022936 in WebCore::LegacyHTMLDocumentParser::scriptHandler 
(this=0x7fa145e89800, state=<value optimized out>)
    at third_party/WebKit/WebCore/html/LegacyHTMLDocumentParser.cpp:504
#15 0x00007fa18b0231e7 in WebCore::LegacyHTMLDocumentParser::parseNonHTMLText 
(this=0x7fa145e89800, src=..., state=<value optimized out>)
    at third_party/WebKit/WebCore/html/LegacyHTMLDocumentParser.cpp:347
#16 0x00007fa18b02101c in WebCore::LegacyHTMLDocumentParser::parseTag 
(this=0x7fa145e89800, src=..., state=<value optimized out>)
    at third_party/WebKit/WebCore/html/LegacyHTMLDocumentParser.cpp:1511
#17 0x00007fa18b02176a in advance (state=<value optimized out>, this=<value 
optimized out>)
    at third_party/WebKit/WebCore/html/LegacyHTMLDocumentParser.cpp:1678
#18 WebCore::LegacyHTMLDocumentParser::write (state=<value optimized out>, 
this=<value optimized out>)
    at third_party/WebKit/WebCore/html/LegacyHTMLDocumentParser.cpp:1779
#19 0x00007fa18add0691 in WebCore::DecodedDataDocumentParser::appendBytes 
(this=0x7fa145e89800, writer=0x7fa145eac620, 
    data=0x7fa149549100 "<script></script><html>\r\n<head>\r\n<meta 
http-equiv=\"Content-Type\" content=\"text/html; 
charset=UTF-8\"/>\r\n<title>37cs</title>\r\n<style type=\"text/css\">body 
{margin: 0;}</style>\r\n</head>\r\n<body>\r\n<script l"..., length=<value 
optimized out>, shouldFlush=false)
    at third_party/WebKit/WebCore/dom/DecodedDataDocumentParser.cpp:55
#20 0x000000000050221a in WebKit::WebFrameImpl::commitDocumentData 
(this=0x7fa14d851600, 
    data=0x7fa149549100 "<script></script><html>\r\n<head>\r\n<meta 
http-equiv=\"Content-Type\" content=\"text/html; 
charset=UTF-8\"/>\r\n<title>37cs</title>\r\n<style type=\"text/css\">body 
{margin: 0;}</style>\r\n</head>\r\n<body>\r\n<script l"..., dataLen=1403)
    at third_party/WebKit/WebKit/chromium/src/WebFrameImpl.cpp:1022
#21 0x000000000053ed83 in WebKit::FrameLoaderClientImpl::committedLoad 
(this=0x7fa14d851610, loader=0x7fa145e88c00, 
    data=0x7fa149549100 "<script></script><html>\r\n<head>\r\n<meta 
http-equiv=\"Content-Type\" content=\"text/html; 
charset=UTF-8\"/>\r\n<title>37cs</title>\r\n<style type=\"text/css\">body 
{margin: 0;}</style>\r\n</head>\r\n<body>\r\n<script l"..., length=1403)
    at third_party/WebKit/WebKit/chromium/src/FrameLoaderClientImpl.cpp:1042
#22 0x00007fa18b0c992e in WebCore::DocumentLoader::commitLoad 
(this=0x7fa145e88c00, 
    data=0x7fa149549100 "<script></script><html>\r\n<head>\r\n<meta 
http-equiv=\"Content-Type\" content=\"text/html; 
charset=UTF-8\"/>\r\n<title>37cs</title>\r\n<style type=\"text/css\">body 
{margin: 0;}</style>\r\n</head>\r\n<body>\r\n<script l"..., length=1403)
    at third_party/WebKit/WebCore/loader/DocumentLoader.cpp:280
#23 0x00007fa18b112f25 in WebCore::ResourceLoader::didReceiveData 
(this=0x7fa145eb6800, 
    data=0x7fa149549100 "<script></script><html>\r\n<head>\r\n<meta 
http-equiv=\"Content-Type\" content=\"text/html; 
charset=UTF-8\"/>\r\n<title>37cs</title>\r\n<style type=\"text/css\">body 
{margin: 0;}</style>\r\n</head>\r\n<body>\r\n<script l"..., length=1403, 
lengthReceived=1403, allAtOnce=176)
    at third_party/WebKit/WebCore/loader/ResourceLoader.cpp:260
#24 0x00007fa18b0fcbea in WebCore::MainResourceLoader::didReceiveData 
(this=0x7fa145eb6800, 
    data=0x7fa149549100 "<script></script><html>\r\n<head>\r\n<meta 
http-equiv=\"Content-Type\" content=\"text/html; 
charset=UTF-8\"/>\r\n<title>37cs</title>\r\n<style type=\"text/css\">body 
{margin: 0;}</style>\r\n</head>\r\n<body>\r\n<script l"..., length=1403, 
lengthReceived=1403, 
    allAtOnce=<value optimized out>) at 
third_party/WebKit/WebCore/loader/MainResourceLoader.cpp:405
#25 0x00007fa18b112495 in WebCore::ResourceLoader::didReceiveData 
(this=0x7fa145eb6800, 
    data=0x7fa149549100 "<script></script><html>\r\n<head>\r\n<meta 
http-equiv=\"Content-Type\" content=\"text/html; 
charset=UTF-8\"/>\r\n<title>37cs</title>\r\n<style type=\"text/css\">body 
{margin: 0;}</style>\r\n</head>\r\n<body>\r\n<script l"..., length=1403, 
lengthReceived=1037393328)
    at third_party/WebKit/WebCore/loader/ResourceLoader.cpp:431
#26 0x00000000004edad5 in WebCore::ResourceHandleInternal::didReceiveData 
(this=0x7fa145e57600, 
---Type <return> to continue, or q <return> to quit--- 
    data=0x7fa149549100 "<script></script><html>\r\n<head>\r\n<meta 
http-equiv=\"Content-Type\" content=\"text/html; 
charset=UTF-8\"/>\r\n<title>37cs</title>\r\n<style type=\"text/css\">body 
{margin: 0;}</style>\r\n</head>\r\n<body>\r\n<script l"..., dataLength=1403)
    at third_party/WebKit/WebKit/chromium/src/ResourceHandle.cpp:173
#27 0x00007fa190507373 in 
webkit_glue::WebURLLoaderImpl::Context::OnReceivedData (this=0x7fa145e80640, 
    data=0x7fa149549100 "<script></script><html>\r\n<head>\r\n<meta 
http-equiv=\"Content-Type\" content=\"text/html; 
charset=UTF-8\"/>\r\n<title>37cs</title>\r\n<style type=\"text/css\">body 
{margin: 0;}</style>\r\n</head>\r\n<body>\r\n<script l"..., len=1403)
    at webkit/glue/weburlloader_impl.cc:538
#28 0x00000000004a40da in RequestProxy::NotifyReceivedData 
(this=0x7fa145e4df00, bytes_read=1403) at my_resource_loader_bridge.cpp:202
#29 0x000000000049ff55 in DispatchToMethod<RequestProxy, void 
(RequestProxy::*)(int), int> (obj=0x7fa145e4df00, method=
    (void (RequestProxy::*)(RequestProxy *, int)) 0x4a3f44 
<RequestProxy::NotifyReceivedData(int)>, arg=...)
    at /usr/local/app/chromium/src/base/tuple.h:422
#30 0x000000000049ff92 in RunnableMethod<RequestProxy, void 
(RequestProxy::*)(int), Tuple1<int> >::Run (this=0x7fa145eb9f40)
    at /usr/local/app/chromium/src/base/task.h:323
#31 0x00007fa190eba98c in MessageLoop::RunTask (this=0x7fa191791600, 
task=0x7fa145eb9f40) at base/message_loop.cc:366
#32 0x00007fa190ebaa5e in MessageLoop::DeferOrRunPendingTask 
(this=0x7fa191791600, pending_task=...) at base/message_loop.cc:375
#33 0x00007fa190ebaca1 in MessageLoop::DoWork (this=0x7fa191791600) at 
base/message_loop.cc:482
#34 0x000000000049a0e3 in MyMessageLoopForUI::DoWork (this=0x7fa191791600) at 
my_message_loop_for_ui.cpp:39
#35 0x00007fa190f267b3 in base::MessagePumpForUI::RunWithDispatcher 
(this=0x7fa17d78e480, delegate=0x7fa191791600, dispatcher=0x0)
    at base/message_pump_glib.cc:199
#36 0x00007fa190f27147 in base::MessagePumpForUI::Run (this=0x7fa17d78e480, 
delegate=0x7fa191791600) at ./base/message_pump_glib.h:59
#37 0x00007fa190ebb483 in MessageLoop::RunInternal (this=0x7fa191791600) at 
base/message_loop.cc:214
#38 0x00007fa190ebb4a3 in MessageLoop::RunHandler (this=0x7fa191791600) at 
base/message_loop.cc:186
#39 0x00007fa190ebb548 in MessageLoop::Run (this=0x7fa191791600) at 
base/message_loop.cc:164
#40 0x0000000000482daf in main (argc=2, argv=0x7fff3dd58188) at 
ChromeServer.cpp:185
  
  ------------------ Original ------------------
  From:  "Vyacheslav Egorov"<[email protected]>;
 Date:  Fri, Jul 30, 2010 01:08 AM
 To:  "v8-users"<[email protected]>; 
 
 Subject:  Re: [v8-users] v8 gc too slow, why?

  
 >> 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

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

Reply via email to