Aaron Yodaiken
Aaron Yodaiken

Reputation: 19551

Is anybody making a Node-optimized V8?

Is there an optimized version of V8 for server-side JavaScript (Node, primarily)? I ask because I assume normal V8 is optimized for Chrome, thus client side JavaScript.

Upvotes: 4

Views: 1667

Answers (1)

Erik Corry
Erik Corry

Reputation: 76

It used to be the case that V8's memory management was not optimized for very big heaps. However with the new GC starting in V8 version 3.7 that should be history. Run with the --max-old-space-size=8192 flag. Now you can have an 8Gbyte heap instead of the normal 1.4Gbyte limit.

If short pauses are very important to you you can also use the --max-new-space-size=2048 flag. This will reduce peak performance, but shorten the pauses from somewhere around 100ms to more like 20ms. On the other hand if you only care about peak performance and do not care about long pause times you can use the --noincremental-marking flag. With this flag you can expect pause times of around 1 second per gigabyte, so it would mainly be useful for small heaps or batch processing tasks.

Upvotes: 6

Related Questions