Live data from Hacker News

Fall cleaning: Optimizing V8 memory consumption

v8project.blogspot.com

1–10 of 43 posts

Re: Fall cleaning: Optimizing V8 memory consumption

#3
Mostly sounds like a case of fixing up some non-optimal defaults - the real hard part is gathering data from real world use cases which is required to make your defaults better.

1) Reducing the V8 heap page size from 1M to 512KB ... results in 2x memory reduction

2) The memory visualization tool helped us discover that the background parser would keep an entire zone alive long after the code was already compiled. ... resulted in reduced average and peak memory usage.

3) C++ compiler not packing structs optimally for V8s case - manual packing saves some peak memory.

Re: Fall cleaning: Optimizing V8 memory consumption

#4

Mostly sounds like a case of fixing up some non-optimal defaults - the real hard part is gathering data from real world use cases which is required to make your defaults better. 1) Reducing the V8 heap page size from 1M to 512KB ... results in 2x memory reduction 2) The memory visualization tool helped us discover that the background parser would keep an entire zone alive long after the code was already compiled. ...…

[deleted]

Re: Fall cleaning: Optimizing V8 memory consumption

#5
I was confused by the article.

  "Reducing the V8 heap page size from 1M to 512KB results 
  in a smaller memory footprint when not many live objects 
  are present and lower overall memory fragmentation 
  up to 2x."
Is it common to say something's shrunk by 2x? Why not say 0.5x (or 50%, half, etc.) I understand growth of 2x and assume this is a mistake, though I'm open to convention.

Re: Fall cleaning: Optimizing V8 memory consumption

#6

I was confused by the article. "Reducing the V8 heap page size from 1M to 512KB results in a smaller memory footprint when not many live objects are present and lower overall memory fragmentation up to 2x." Is it common to say something's shrunk by 2x? Why not say 0.5x (or 50%, half, etc.) I understand growth of 2x and assume this is a mistake, though I'm open to convention.

It's confusing. I'd think it means it shrunk 0-2 times by an indeterminate amount.

Re: Fall cleaning: Optimizing V8 memory consumption

#7

I was confused by the article. "Reducing the V8 heap page size from 1M to 512KB results in a smaller memory footprint when not many live objects are present and lower overall memory fragmentation up to 2x." Is it common to say something's shrunk by 2x? Why not say 0.5x (or 50%, half, etc.) I understand growth of 2x and assume this is a mistake, though I'm open to convention.

Because it grew by 0.5x ;)

Re: Fall cleaning: Optimizing V8 memory consumption

#10
post #2

Hope they don't adversely affect Node's performance with this tuning for low memory devices

Mozilla's memory project a while ago showed that there's often a lot of low hanging fruit if it hasn't been a big focus. V8 uses a lot of memory in comparison in my experience. I think this should be generally without a downside.
Post reply on HN