Virtual memory paging algorithm