Add dirty page counting for debug