synchronized CacheEntry findVictim(boolean forUncache) { Item victim = findMin(); if (forUncache) entries.remove(victim); return victim.entry; int id_out; FreeSlots++; if (A1in.getLength() > Kin) { Job A1inTail = A1in.DequeueFront(); id_out = A1inTail.JobID(); Job headerJob = new Job(id_out, 1); A1out.EnqueueJob(0, headerJob); if (A1out.getLength() > Kout) { Job removedHeader = A1out.DequeueFront(); removedHeader = null; } // put X into the reclaimed page slot return A1inTail; } else { Job AmTail = Am.DequeueFront(); // put X into the reclaimed page slot return AmTail; } }