Large arrays are allocated on V8's managed heap (in "Large Object Space"). You won't see an mmap call for that, because the heap's entire address space is reserved (without committing / reserving the underlying physical memory) in one go up front. When new pages are needed, they are committed with mprotect. The GPU process doesn't know or care about any of that (and can never share large JS arrays with V8); whatever you've been seeing in the GPU process must be some unrelated artifact.
On Fri, Feb 3, 2023 at 2:04 AM 'Yusi Feng' via v8-dev < [email protected]> wrote: > Hello everyone, > > I use javascript to create a large array. > new Array(1024 * 1024 * 10).fill(0) > I'm wondering where the memory for this large array comes from. I printed > all the mmap()'s with chromium and almost all of the mmap()'s were shared > and appended to a file. > > I thought the memory for the array was created by PartitionAlloc and V8 of > the renderer process. But every time I create a new array, the gpu process > uses mmap to allocate new virtual memory for the same file (fd=502). And > the memory space it allocates is smaller than the size of my array. > > How to understand shared memory between renderer process and GPU process? > Where does the memory for the array come from? > > Thanks, > Yusi > > -- > -- > v8-dev mailing list > [email protected] > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/v8-dev/a74d6e3b-0f52-41b5-90be-566c0034fcdan%40googlegroups.com > <https://groups.google.com/d/msgid/v8-dev/a74d6e3b-0f52-41b5-90be-566c0034fcdan%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- -- v8-dev mailing list [email protected] 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAKSzg3RDsCBWLp5yzNzaHFhG3e8iWdeCektMu9_%3D2ct04yC7Sg%40mail.gmail.com.
