I read a book,it said that in every process its stack
beginning address is the same in logical address.
Is it right?If it is right,then other beginning address
such as text and data? and I want to know how to allocate
virtual memory in linux?
Your not accidentally looking for malloc or new?
]]>So to just randomly allocate virtual memory that will not be used would mean to go in a loop and continue to kick things out of your cache in order to fit the next one, since all of it will not fit- unless you are only doing it for a small bit to prefetch it into some level of your cache.
So if you want to allocate virtual memory, which in turn becomes physical memory, just ask to read the memory address and it will be temporarily allocated (as well as those around it, based on spacial locality, because the cache line and the page of cache lines were also pulled in)
]]>This process is done largely in hardware, partially by the OS. As an application programmer, you can't tell the kernel or the CPU where to place your data, and you shouldn't really bother with it. Unless you're specifically interested in virtual memory, in which case you should perhaps pick up a book on OS design and/or computer architecture.
]]>The kernel allocates virtual memory as needed. You can affect how likely it is to use virtual memory. You can stop it using it altogether. But once you set the parameters, you let the kernel get on with it. Perhaps I don't understand the question?
]]>