Hacker News new | ask | show | jobs
by atfzl 1687 days ago
This made be curious to check the real and virtual memory of some processes on my laptop (MacBook Air M1).

The real memory size of Safari is ~160MB but virtual memory size is 392GB which doesn't look right. I checked other processes and all the processes have similar virtual memory size which is around ~390GB.

I wonder if this is a bug in Activity Monitor or the virtual memory allocations really are this big for each process.

2 comments

That sounds about right. The runtime of a certain language actually allocates 1TB of virtual memory at startup, and then hands out memory from that pool. It's just reserving 1TB of virtual address space.
That’s likely because of the dyld shared cache.