I'm having trouble with understanding something from my programming lecture. I know that page replacement algorithms have page faults.
In the LRU algorithm, when does a page fault occur? Is it when there are no more free frames left? Is it when a frame is already there, but already used too?
I have this picture in my lecture presentations (I cropped just the important part since the original is in another language):
The question in this picture is "Having only 4 frames, when will a page fault occur if the LRU algorithm is used?" And as I can see there is an x on the first 3 lines. That's why I'm asking if a page fault occurs when there are free frames left? Or does a page fault occur only in the red X's, when we need to "kick out" a frame?