Updates:
        Summary: A benchmark that only compiles code runs out of memory.
        Status: WorkingAsIntended
        Cc: -erik.corry
        Labels: -HW-x64 HW-All

Comment #1 on issue 458 by [email protected]: A benchmark that only  
compiles code runs out of memory.
http://code.google.com/p/v8/issues/detail?id=458

The compilation cache saves scripts, and links them to their compiled  
versions, for
five generations, where each mark-sweep or mark-compact garbage collection  
is a
generation.  If all a program does is compile scripts, this can allocate  
enough
memory, and keep it alive for five generations, so that the total memory  
keeps on
growing, even though each compiled script is eventually discarded.

We investigated various ways to count how much memory is being kept alive  
by the
compilation cache, and to put a limit on it, but they either gave useless  
numbers, or
were too invasive.  Even with a good number for this, it is not clear how  
we would
want to limit it.

Reducing the number of generations in the compilation cache does mitigate  
the
problem, but not much.  Reducing from 5 to 4 has no real effect, due to a  
strange
pattern in cache sizes.  Reducing from 5 to 3 has a big effect - memory  
keeps
growing, but much more slowly.  But the number of generations was tuned by  
measuring
histograms of user browser use, and the 4th and 5th generations hit about  
5%-10% of
the time, making them worthwhile.

Unless we see any case where this arises in actual browser use, I think  
this is a
problem with the benchmark, not with V8.  We should keep this issue in mind  
for
memory-constrained platforms, though, and consider one option - pre-aging  
scripts
when they first enter the cache, placing them in generation 2, and only  
bumping them
to generation 0 when they are hit.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to