Latest increasing memory virtual Weblinks:
- Re: how to get physical memory address from virtual memory address
Hari wrote: Get it for what purpose? As it is process virtual memory, the physical address may change at any time due to paging activity!- 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
What?? This is entirely incorrect. EVERY valid virtual address has an associated physical address. In the case of malloc-ed memory, that physical address will be in physical memory. Addressing the OP, while you are in user mode, the physical address can change at any time. The only reliable way to get the physical address is- 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
Hi all, Thanks for the response from you all. My aim is to execute SDRAM diagnostics code to find which part of SDRAM chip is failed. So in code, I am using malloc to allocte available free memory and then locking the memory using mlock. I think once the mlock is done the pages what ever is allocted during malloc will be in the- Re: how to get physical memory address from virtual memory address
Not true. When the respective page is swapped out, there is no physical address associated to given virtual address.
FREE NEWSLETTER
|
| Latest News, and Special Offers on Memory enter your name and email address here: |
|
|
|
|