Where does the memory for large arrays come from?

80 views
Skip to first unread message

Yusi Feng

unread,
Feb 3, 2023, 2:42:41 PM2/3/23
to Chromium-dev
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
Reply all
Reply to author
Forward
0 new messages