A lot of those flags exist solely for debugging purpose: it's
sometimes useful to switch something off and see if some issue stays
to be reproducible. This allows to quickly bisect things in a system
which has a lot of moving parts. Debugging flags are really not
intended for any other purposes and should not be used unless you have
an intimate understanding of V8.
Some flags outlived their usefulness (like --incremental_marking_steps
that was quite useful during initial development of incremental GC to
understand if there is an invariant violation between steps or the
problem is somewhere else entirely) and should be probably killed to
avoid confusion.
--collect_maps flag has a somewhat confusing name as well. Its name
implies that maps are not collected when it is turned off, however
this is not true. Maps just start to die in a different way. When
collect_maps is on then edges in map transition trees are reversed
during garbage collection and trees start dying from their leaves:
paths that do not lead to any live objects are cleared from the tree,
but roots are retained. When collect_maps is off transition trees are
just dying from their roots like a normal trees... It's likely that
less maps will die this way due to connection between initial map and
the constructor, but fully dead trees will be surely reclaimed. In
some cases application can exhibit pathological patterns of hidden
classes construction that cause performance degradation due to
frequent GCs when --collect_maps is enabled because parts in
transition tree reappear again and again after being pruned as dead.
But I would not recommend to touch this flag unless you deeply
understand how V8's hidden classes work.
Code flushing (--flush-code) tries to discard compiled code do reduce
memory consumption. Code will be recompiled if somebody needs to
execute this function again. At the moment only non-optimized code is
flushed but in the future V8 might start flushing generated optimized
code as well as it is known to cause increased memory pressure in some
pathological cases. Caches flushing (--cleanup_code_caches_at_gc)
clears inline caches and other suplemental caches used by V8 to
collect typefeedback and adapt for the application. Flushing them
reduces memory pressure (caches use small complied code stubs that can
reference other objects e.g. hidden classes that are no longer
"relevant") and ensures that feedback is not stale. Again both flags
should not be used unless you understand V8 code generation pipeline
from alpha to omega.
--
Vyacheslav Egorov