Garbage collections have to visit all objects that are alive, so as to find the memory that can be reclaimed.  (Having many generations just delays this a bit)  All things being equal, it is clearly better to first visit the object that are already paged into RAM, before paging other block in and therefore paging out some object.Anther possibility is that when the OS wishes to take a page of ram away from the process, the GC is first asked if it has a page that can be given up without needing to be paged out.   The GC may  be mostly done with moving objects from a page, so can clear that page within the time limit the OS has for needing a page.Yet, I cannot recall any garbage collector that integrates with the OS paging system that drive the order the GC works in. 
Are there any garbage collectors that take into account paging?
memory management;paging;garbage collection