How to know when memory pages are swapped?