Score:0

Can virtual memory exceed physical memory? (RAM + Hard Drive)?

ng flag

The glances program tells that a google chrome page consumes 1.10 TB virtual memory and my PC does not have this capacity (RAM + Hard Drive). enter image description here

About this, quora explains the following: "virtual memory can exceed physical memory. Virtual memory is a system memory management technique that allows a program to use more memory than is physically available on the computer by temporarily transferring data to disk storage. This allows the program to continue running even if all physical memory is in use."

case concrete: If the PC has 16 GB RAM + 500 GB SSD, is it possible that the virtual memory, in a single process, can exceed the physical memory and reach 1.10 TB?

Thk

Score:2
fr flag

Yes, virtual memory ranges can be backed not only by RAM/swap or memory-mapped files, but also by nothing at all – it is possible to create an enormous anonymous mapping that remains mostly empty, and therefore does not correspond to physical RAM allocation (also known as 'overcommit' on Linux), remaining mostly mapped to just a single "zero" page.

(Note that "virtual memory" here does not mean "swap" or "pagefile" – that is Windows terminology which does not match Linux. Here, "virtual memory" means abstract virtual address space.)

The Golang and Haskell runtimes used to implement their internal memory allocation by creating a single terabyte-sized mapping upfront, instead of smaller "arenas" on-demand as e.g. C malloc() does. Both have since stopped doing so, but in the past it was not unusual to see a Haskell process using >1TiB of virtual memory addresses.

JavaScript runtimes such as WebKit JSCore or Chrome V8 implement the so-called "Gigacage", which reserves empty virtual-address regions tens of gigabytes in size (multiple of them) in order to enforce certain distance between different types of allocations.

acgbox avatar
ng flag
great thanks a lot for your help
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.