How to tune the garbage collector interval in v8 (--gc_interval is not working)

2,044 views
Skip to first unread message

WENZHI CUI

unread,
Jun 11, 2016, 10:14:15 AM6/11/16
to v8-users
Hi all,
  Sorry to disturb you all but I have a question regarding tuning GC interval in v8.

  I am using Node.js v4.2.1 (with Google v8 v4.5.103) as development platform. I want to study the impact of garbage collector on the overall system performance hence I have to run experiments under different GC settings. In specific, I want to change the interval of GC.

  I tried setting the option "--gc_interval" but it is not working under Release mode (i.e., GC interval is not changed by the option) and will cause a crash under Debug Mode.  So I am wondering if this option is no longer supported or there is something wrong with my setup? 

  Also, if you know other effective ways to tune GC activities (options or source code parameters), that will also help my study. Thanks for your time.

Yours,
Wenzhi Cui

Yang Guo

unread,
Jun 13, 2016, 1:43:42 AM6/13/16
to v8-users
--gc-interval is a debugging flag and not supposed to be used for production.

WENZHI CUI

unread,
Jun 13, 2016, 12:16:23 PM6/13/16
to v8-users
Hi Yang,
  Thanks very much for the reply. 
  I have one follow-up question:
  Is there any way to change GC activities other than setting heap size? I don't mind tweaking the source code if options are not exported. 

Thanks,
Wenzhi Cui

Yang Guo

unread,
Jun 27, 2016, 7:06:32 AM6/27/16
to v8-users
You can run V8 with --expose-gc. You can then call gc() to manually trigger gc. Don't assume this to be officially supported though.
Reply all
Reply to author
Forward
0 new messages