1
votes

I am very much confused about the allocation of virtual memory to a process.

How does the OS determine the amount of "virtual memory" which should be assigned to a process? Does it depend on the process size?

Does it depend on the size of the RAM ("main memory")? If yes, then suppose the size of the RAM is 4GB, and the resident OS takes 1GB for its execution: how much virtual memory will be assigned to a process?

1

1 Answers

0
votes

The virtual memory is usually the sum of the resident memory and everything that is not mapped into physical memory, e.g. swap, open files etc. The operating system doesn't determine the size of the memory -- a process allocates memory explicitly to do what it wants to do. Other memory (e.g. for mapped files) is allocated implicitly, but there, too, the amount of memory is determined by the size of the resource.