Latest physical memory Weblinks:
- Re: how to get physical memory address from virtual memory address
Of course, you are wrong. Virtual addresses /only/ have corresponding physical addresses when they are used in a memory reference. Pure "allocation" (malloc()) doesn't result in a memory reference, so no real address is assigned. (FWIW, this is why the OOM killer works the way it does - it kills processes that have allocated memory- Re: how to get physical memory address from virtual memory address
Hari wrote: You have to do this in the kernel. Firstly, the page obviously has to be nailed down (unswappable). Otherwise it has no fixed physical address. When paged out, it has no address at all, and may get a different physical address each time it is paged out. You can do this using the get_user_pages() kernel function, which will- Re: how to get physical memory address from virtual memory address
Really? So what happens when the page is swapped out? It's still a valid virtual address, but there's no valid physical address behind it, until it's swapped back in by a page-fault or the prefetcher. -n- Re: malloc more than physical memory
Thank you. The swap file is the problem as it is sized to only 2GB.- Re: how to get physical memory address from virtual memory address
Let's see if this is true. I have a machine with 1GB of physical memory: $ free total used free shared buffers cached Mem: 1035736 996412 39324 0 252808 368224 -/+ buffers/cache: 375380 660356 Swap: 12937128 23420 12913708- malloc more than physical memory
I'm trying to allocate an array that is larger than my physical memory size. My shell limit is set to unlimited, and I've tested this on two identical Linux 2.6.9 Opteron machines that have 4GB of DRAM and 8GB of memory respectively. On the latter machine, malloc indeed succeeds. However this fails on the identical 4GB machine. My test program is
FREE NEWSLETTER
|
| Latest News, and Special Offers on Memory enter your name and email address here: |
|
|
|
|