Why is the physical address the same in all runs?

I run the program with a specific array variable. I take the translation of the virtual address (VA) of this array to the physical address (PA) using the file / proc / self / pagemap, which is supported on Linux systems (ubuntu). I tried to observe the VA-PA display by executing the same program several times (with a time interval between successive runs). What I observed remains unchanged in all runs.

It is reasonable if VA remains the same, but why does PA also remain unchanged.? PA depends on the free pages in RAM that the OS supports. At this point, it should vary depending on the system load. Given all this, I expect the PA to branch out, but, on the contrary, I have observed.

What concept am I missing in OS / Architecture that answers this question?

+4
source share
1 answer

"with a gap in time"

OS expects applications to want to restart, so if the memory does not work and the memory is “free”, it will also have a binary cached file if it starts again. Windows Task Manager reports this quite well.

One time is not enough to free this cache, and the launch of several other applications is also likely to be insufficient; you need to run several unique processes (or just one that uses a lot of memory) to clear the cache.

, acornagl, , ,

+3

Source: https://habr.com/ru/post/1658434/


All Articles