Setting the offscreen page limit to the number of pages minus one to prevent the pages from being garbage collected.