Physical memory request to Linux Kernel
Hello,
I am running a multithreaded program for which I'm in need of acquiring some physical memory from linux kernel. malloc() gives virtually memory mapped memory and then MMU translates that into physical memory... Can someone show me the way to allocate Physical memory directly on linux? (without routing through virtual) Thanks, Tanmay |
You can't do that.
All of the memory seen by any user process is virtual memory. And this is actually what you want. The illusion that is presented to your program is that memory is big and that memory is "all yours." Behind the scenes, the kernel makes sure that this illusion is maintained, separately, for each and every user-program. It uses physical memory and disk-space to achieve that, and you can be assured that it will do that in the most-optimal manner possible under prevailing conditions. |
Thanks for the reply...
I had the doubt that it may not be possible... but now the question is how do I make sure that my application 'thinks' that it has got its own memory area... will "mmap" or "mlock" help me in this? |
All times are GMT -5. The time now is 07:10 PM. |