How to remove page files. (no, you can't download more ram)

Discussion in 'Tech Discussion' started by xiazixin, Mar 4, 2024.

  1. xiazixin

    xiazixin Well-Known Member

    Joined:
    Dec 7, 2017
    Messages:
    1,409
    Likes Received:
    674
    Reading List:
    Link
    Page file is a thing that basically turn your hard disk in to memory when your system run out of memories.
    Since rams works with randoms, while hard disk don't like randoms. Your system would perform horribly when your ram are over ran and the system is resort to using page files.

    So the best way to resolve it, buy more ram and remove page file.
    Please don't says anything about, how your hard disk is fast enough for a page file. I have 900gb of optane.
    upload_2024-3-5_4-4-51.png
    with that note, SO how to remove the page files.
    First, disable virtue memories in CMD.​
    Code:
    fsutil behavior set encryptpagingfile 0
    restart your system,

    press win+R and run SystemPropertiesAdvanced

    which a windows like below will be opened.
    upload_2024-3-5_4-12-28.png

    Clicks on the Performance settings.
    upload_2024-3-5_4-13-25.png

    Click change paging file size, for mine it's zero, yours might be other values.

    upload_2024-3-5_4-14-56.png

    Make sure you disable your automatic manage page files.
    and your page file size for all your disk is zero.
    set all your disk to no paging file.
    and make sure currently allocated page file is 0MB
    then restart your PC.


     

    Attached Files:

    gangbuntu likes this.
  2. gangbuntu

    gangbuntu Well-Known Member

    Joined:
    Jul 9, 2016
    Messages:
    315
    Likes Received:
    251
    Reading List:
    Link
    neat

    but how to prevent oom (out of memory) crashes?
    - it would be easier to happen in linux (with a constant swap size)
    https://qr.ae/pKaIfU
    - tried to make a small windows app that would crash the system due to severe memory leaks, but even after consuming 28gb (on a 16gb system) it didn't crash.

    remember that `hardware is cheap, programmers are expensive`. both hardware and software industries expect end-users to throw money at the problem. google chrome is a very simple example.

    with `active` i/o usage the health of an industrial sd-card stood at 42% (58% wear) after 15 months of usage. impact: very slow system activity.
    * `active`: logging 5 sensors every 15 seconds; i'd say syslog binary logging contributes to write amplification.
    * less active units had 1-19% wear within the same period.

    the cause is related to this: https://en.wikipedia.org/wiki/Write_amplification

    --------------------------------------------

    how to do that in linux? because (though it is also possible) the linux kernel actually prefer to use the swap (designated in the predefined partition).

    --------------------------------------------

    imho rather than completely disabling it, it would be better to set it up the way linux does it: a static swap file/partition.

    setting the swap to the ssd would improve performance (as opposed to the spinning disk) yet prepare for a shorter ssd lifetime.

    --- edit ----
    see also:
    - The MySQL “swap insanity” problem and the effects of the NUMA architecture
    - Non-uniform memory access
     
    Last edited: Mar 4, 2024
    xiazixin likes this.
  3. xiazixin

    xiazixin Well-Known Member

    Joined:
    Dec 7, 2017
    Messages:
    1,409
    Likes Received:
    674
    Reading List:
    Link
    The correct way is to purchase more ram. Personally, I'm getting used to more than 64GB or ram, both my laptop have 64GB of ram and my other two earlier desktop also have 64GB of rams. The current PC only having 32GB (due to been itx and ddr4, I dont want to get an additional ddr4 before switching to ddr5), which often taking a lot of pages files. I personally don't have issues with write amplifications, as both my two active desktop use Optane as the system disk, though I would likely not have the luxury in the future.

    upload_2024-3-5_7-45-47.png
    my second disk, very little compared to the Optane, when they are installed on the same day.

    Some people might say it reduces crashers, but when windows start using the page memory the responsiveness, is really really really bad, personally I'm using an Optane, which have random read and write proportion to the speed of CPU, about triple or quadruple of average consumers. Before it crash.
    Linux, it's another case all together, it's mostly on the back end. That means responsiveness usually have little impact on the usability and the experience of the user. Most program are in the SLI instead of desktop. The main purpose is to keep the program running instead of keeping the system responsive and fast.

    As for home servers, it's cheaper to upgrade ram compared to consumer parts as reg ecc are actually cheaper than consumer none ecc rams.
     
    Last edited: Mar 5, 2024