>
> > What Ben pointed out was virtual memory reservations, which is not the
> same as restricted space sizes.
>
> Would you guys mind expanding on this? My thinking is that the v8 commits
> as much memory as it is allowed for semi/old/code spaces (considering that
> the app doesn't allocate more than fits into these spaces), plus for the
> C++ machinery to maintain these objects and if those sizes are limited to
> some reasonable size, why would v8 reserve more memory that it cannot
> commit?
>

Memory address space is separate from actual memory. There are cases where
it makes sense to reserve a large chunk of address space without requesting
it to be backed by actual memory, usually when a contiguous range may be
required later.
For example, on 64-bit platforms, V8 requires all executable memory to be
within a 2GB section of address space so that calls can use 32-bit offsets,
so it reserves that amount of address space on initialization (which is a
very cheap operation), whereas actual memory is allocated later as needed.
WebAssembly has a similar use case where a large section of address space
is reserved so that *if* it needs to use that memory later, the addresses
will be contiguous.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to