VMemory subclass: #Nfu instanceVariableNames: 'counts' classVariableNames: '' poolDictionaries: '' category: nil ! Nfu comment: 'I am a NFU memory manager' ! Nfu methodsFor: 'instance initialization'! init counts := Dictionary new. ^super init. ! ! !Nfu methodsFor: 'memory access'! removePid: aPid super removePid: aPid. counts keysDo: [ :page | (page pid = aPid) ifTrue: [ counts removeKey: page ] ]. ! insert: page pages add: page. counts at: page put: 0. ! replace: page | temp | temp := counts keyAtValue: (((counts values) asSortedCollection) at: 1). pages remove: temp. counts removeKey: temp. dirty remove: temp ifAbsent: []. self insert: page. ! ! !Nfu methodsFor: 'dirty page handling'! timestep dirty do: [ :page | counts at: page put: ((counts at: page) + 1). ]. ^super timestep. ! !