Skip to content
Advertisement

check if a memory page is loaded into memory

Given a virtual address, I want to know if the memory page mapped into this virtual address has been loaded into memory or in disck. Is there anyway to do check that in user level program? I am using CentOS 7.

Advertisement

Answer

You can use the mincore system call for this.

mincore – determine whether pages are resident in memory

It will tell you which pages in a range are in memory and will not require disk I/O upon access. Note that pages may be swapped out between mincore returning and you accessing them.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement