2009/5/29 ry <[email protected]>: > > I have a web page being served by v8. If I put a large load on it, the > garbage collector executes very often and creates poor response times: > http://s3.amazonaws.com/four.livejournal/20090529/timeseries6.png > > If I have use the --trace_gc option I see this output like this: > Mark-sweep 8.8 -> 1.5 MB, 17 ms. > Mark-compact 8.8 -> 1.5 MB, 35 ms. > Mark-sweep 9.5 -> 1.5 MB, 14 ms. > Mark-sweep 8.8 -> 1.5 MB, 15 ms. > Mark-sweep 8.8 -> 1.5 MB, 15 ms. > Mark-sweep 8.8 -> 1.5 MB, 15 ms. > Mark-sweep 8.8 -> 1.5 MB, 16 ms. > Mark-sweep 8.8 -> 1.5 MB, 16 ms. > Mark-sweep 11.5 -> 1.6 MB, 40 ms. > Mark-sweep 11.6 -> 1.6 MB, 22 ms. > Mark-sweep 11.5 -> 1.6 MB, 21 ms. > Mark-compact 11.6 -> 1.6 MB, 42 ms. > Mark-sweep 11.7 -> 1.6 MB, 21 ms. > Mark-sweep 11.6 -> 1.6 MB, 21 ms. > Mark-compact 11.6 -> 1.6 MB, 61 ms. > Mark-sweep 11.8 -> 1.6 MB, 21 ms. > Mark-sweep 11.6 -> 1.6 MB, 21 ms. > Mark-compact 11.6 -> 1.6 MB, 42 ms. > Mark-sweep 11.7 -> 1.6 MB, 21 ms. > Mark-sweep 11.5 -> 1.6 MB, 21 ms. > Mark-compact 11.6 -> 1.6 MB, 39 ms. > Mark-sweep 11.8 -> 1.6 MB, 21 ms. > Mark-sweep 11.5 -> 1.6 MB, 22 ms. > Mark-compact 11.6 -> 1.6 MB, 39 ms. > Mark-sweep 11.7 -> 1.6 MB, 20 ms. > Mark-sweep 11.6 -> 1.6 MB, 24 ms. > Mark-compact 11.5 -> 1.6 MB, 40 ms. > Mark-sweep 11.8 -> 1.6 MB, 21 ms. > Mark-sweep 11.6 -> 1.6 MB, 21 ms. > Mark-compact 11.5 -> 1.6 MB, 45 ms.
You are getting only full GCs, no young generation GCs. This could indicate that you are somehow allocating in the old space. This could be because you are using eval very heavily or because you are allocating large arrays (more than 2000 elements). Wild guess: If you use new Array(50000) you will get a very large array. If you don't intend to fill the array you should use new Array() and then set the .length property afterwards. You could use the V8 profiler to see where it is spending time. It must be spending a lot of time to allocate so much data. > but it doesn't mean much to me. > > I wonder if anyone has some tips about getting the garbage collector > to run less frequently. > > thanks > > > -- Erik Corry, Software Engineer Google Denmark ApS. CVR nr. 28 86 69 84 c/o Philip & Partners, 7 Vognmagergade, P.O. Box 2227, DK-1018 Copenhagen K, Denmark. --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
