Hi everyone,

On several occasions, website owners have asked me about seemingly 
unlimited growth over time in the "compiled code" section of a heap 
snapshot. They're concerned about what appears to be a memory leak in V8 
which could affect their customers. They've also told me that writing 
automated tests to detect memory usage regressions is hard because the page 
never reaches a steady-state maximum memory usage when performing repeated 
actions. As far as I can tell, V8 is functioning as intended, and the 
memory growth is due to functions tiering up into more optimized states. 
After infinite time of interacting with the page, every used function would 
reach its maximally optimized state, and the growth would halt. However, my 
explanation that the memory usage is actually asymptotic toward a distant 
limit is not very reassuring, and I think that these website owners have a 
good point. To my knowledge, V8's tier-up heuristics are based on counting 
total usage per function, which is useful for quick startup and 
short-running benchmarks, but might not be optimal for long-lived web 
pages. If it took 20 minutes of occasional calls for a function to 
accumulate enough usage that it becomes optimized, then maybe that function 
should remain unoptimized to save memory.

Have any of you looked into this problem before? (And do you consider it a 
real problem?) I have some vague notions for how we might focus on recent 
usage rather than total usage when deciding whether to optimize a function, 
but I'd be keen to hear about any previous explorations or ideas.

Thanks,
Seth

-- 
-- 
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/ce9c9fa9-14dc-4ac4-92f5-0226cff1ffe6n%40googlegroups.com.

Reply via email to