{
    "mode": "man",
    "parameter": "proc_pid_clear_refs",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/proc_pid_clear_refs/5/json",
    "generated": "2026-10-04T21:06:41Z",
    "sections": {
        "NAME": {
            "content": "/proc/pid/clearrefs - reset the PGReferenced and ACCESSED/YOUNG bits\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "/proc/pid/clearrefs (since Linux 2.6.22)\n\nThis is a write-only file, writable only by owner of the process.\n\nThe following values may be written to the file:\n\n1 (since Linux 2.6.22)\nReset  the  PGReferenced  and ACCESSED/YOUNG bits for all the pages associated\nwith the process.  (Before Linux 2.6.32, writing any nonzero value to this file\nhad this effect.)\n\n2 (since Linux 2.6.32)\nReset the PGReferenced and ACCESSED/YOUNG bits for all anonymous pages associ‐\nated with the process.\n\n3 (since Linux 2.6.32)\nReset the PGReferenced and ACCESSED/YOUNG bits for all file-mapped pages asso‐\nciated with the process.\n\nClearing the PGReferenced and ACCESSED/YOUNG bits provides a method  to  measure  ap‐\nproximately  how much memory a process is using.  One first inspects the values in the\n\"Referenced\" fields for the VMAs shown in /proc/pid/smaps to get an idea of the memory\nfootprint of the process.  One then clears the PGReferenced and  ACCESSED/YOUNG  bits\nand,  after some measured time interval, once again inspects the values in the \"Refer‐\nenced\" fields to get an idea of the change in memory footprint of the  process  during\nthe  measured  interval.  If one is interested only in inspecting the selected mapping\ntypes, then the value 2 or 3 can be used instead of 1.\n\nFurther values can be written to affect different properties:\n\n4 (since Linux 3.11)\nClear the soft-dirty bit for all the pages associated with the  process.   This\nis used (in conjunction with /proc/pid/pagemap) by the check-point restore sys‐\ntem  to  discover  which  pages  of  a process have been dirtied since the file\n/proc/pid/clearrefs was written to.\n\n5 (since Linux 4.0)\nReset the peak resident set size (\"high water mark\") to the  process's  current\nresident set size value.\n\nWriting any value to /proc/pid/clearrefs other than those listed above has no effect.\n\nThe  /proc/pid/clearrefs  file is present only if the CONFIGPROCPAGEMONITOR kernel\nconfiguration option is enabled.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "proc(5)\n\nLinux man-pages 6.7                          2023-09-07                       procpidclearrefs(5)",
            "subsections": []
        }
    },
    "summary": "/proc/pid/clearrefs - reset the PGReferenced and ACCESSED/YOUNG bits",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "proc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
        }
    ]
}