It used to be that V8 memory management was not optimized for very large heaps. However, with the new GC, starting with version V8 3.7, which should be history. Run the flag -max-old-space-size = 8192. Now you can have a bunch of 8 GB instead of the usual limit of 1.4 GB.
If short pauses are very important to you, you can also use the -max-new-space-size = 2048 flag. This will reduce maximum performance, but shorten pauses from about 100 ms to more than 20 ms. On the other hand, if you only care about maximum performance and do not care about long pauses, you can use the -noincremental-marking flag. With this flag, you can expect pause periods of about 1 second per gigabyte, so this will mostly be useful for small heap or batch processing tasks.
source share