virtual memory in linux

Hi,
I read virtual memory. But i have some confusion about useability of virtual memory.

is virtual meory of linux system is total physical memory attached(i.e RAM)+swap space(set in linux system) equal to virtual memory?

How can i decide, how much virtual memory is required for system?


--------
Learner
is virtual meory of linux system is total physical memory attached(i.e RAM)+swap space(set in linux system) equal to virtual memory?
Yes.

How can i decide, how much virtual memory is required for system?
The amount of memory required depends on its use.
But i thing virtual memory should be RAM+Swap space+cache memory. am i right ?

how can i know estimate of required virtual memory?
You have to run your program in a number of different scenarios to determine its actual performance profile (CPU, IO, memory, ...)
is virtual memory =RAM+Swap space+cache memory?


second, is heap reside in virtual memory for dynamic memory allocation?
Virtual memory is a means of pretending there's more RAM on the box than there really is. Physical RAM is page out to disk to create this illusion. This total virtual memory is the size of the total physical RAM available to the OS plus the sum of the swap files/partitions available to the OS.

The C and C++ virtual machine (the view of what a computer is from the C/C++ perspective), is there's virtual memory, no other kind. This virtual memory is split into two types, the global heap and the run-time stack which grow from opposite ends of the total memory.

There is no notion of the stack living in physical RAM. You're confusing layers.
Topic archived. No new replies allowed.