windows3-1 Exercise 2: Prove the Commit Limit Rule ================================================================= Verification: Level 1 (read-only; run on the author's machine, no administrator rights). Prediction (work this out before running the script): Commit limit = usable RAM + the allocated size of every page file, so RAM + page file should match the Commit Limit counter exactly (to the byte), and Committed Bytes should be a modest percentage of the limit on a healthy machine. ex2.ps1 (run it with: powershell -ExecutionPolicy Bypass -File ex2.ps1): # ex2.ps1: does the commit limit equal usable RAM plus the page file(s)? $ram = (Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory $page = (Get-CimInstance Win32_PageFileUsage | Measure-Object AllocatedBaseSize -Sum).Sum * 1MB $cl = (Get-Counter '\Memory\Commit Limit').CounterSamples[0].CookedValue $cb = (Get-Counter '\Memory\Committed Bytes').CounterSamples[0].CookedValue 'Usable RAM : {0,15:N0} bytes' -f $ram 'Page file(s) : {0,15:N0} bytes' -f $page 'RAM + page file : {0,15:N0} bytes' -f ($ram + $page) 'Commit limit : {0,15:N0} bytes' -f $cl 'Match? : ' + (($ram + $page) -eq $cl) 'Committed : {0,7:N2} GB = {1:N1} % of the limit' -f ($cb / 1GB), (100 * $cb / $cl) 'Committed vs RAM : {0,7:N2} GB committed, {1:N2} GB usable RAM' -f ($cb / 1GB), ($ram / 1GB) Output (real, from the author's machine on 2026-10-24; your numbers will differ): Usable RAM : 31,982,632,960 bytes Page file(s) : 51,539,607,552 bytes RAM + page file : 83,522,240,512 bytes Commit limit : 83,522,240,512 bytes Match? : True Committed : 22.94 GB = 29.5 % of the limit Committed vs RAM : 22.94 GB committed, 29.79 GB usable RAM WHY THIS WORKS AS AN ANSWER --------------------------- 31,982,632,960 + 51,539,607,552 = 83,522,240,512, which is the commit limit to the byte, so Microsoft's statement "this limit is the sum of physical memory (RAM) and all page files combined" is confirmed on this machine. Committed memory is 22.94 GB, 29.5 % of the limit: plenty of headroom. Committed (22.94 GB) is smaller than the usable RAM (29.79 GB) here, but the two are unrelated quantities and need not be: commit can exceed RAM because the page file makes up the difference. Common mistakes: using the installed 32 GB instead of the usable 29.79 GB (the totals then differ by about 2.2 GB); forgetting that Win32_PageFileUsage reports megabytes (AllocatedBaseSize is in MB, so multiply by 1MB); and trying this on a machine with a page file that changes size while you measure, where the values can move between the two reads.