0

On my computer running Windows (10) I have memory usage troubles. Not wanting Windows do useless IO with high RAM amount available: I disabled the swap file (no paging file on any disk).

When doing stuff with apps, memory usage increases. At some point some apps crash with an OutOfMemory exception, or just becomes unstable and requires manual stop.

When it occurs, here is what I see:

  • RAM installed is 64 GiB
    • 2x DDR4 2667 16 GiB modules
    • 2x DDR4 3200 16 GiB modules (added later)
  • task manager indicates
    • an almost full memory usage in the graph (around 53/64 GiB)
    • around 36 GiB "In use" (0 MiB compressed)
    • around 11 GiB "Available"
    • around 24 GiB "Cached"
    • around 61 GiB "Commited"
    • around 2.2 GiB "paged pool"
    • around 2.1 GiB "non-paged pool"
  • no significant disk activity
  • SuperFetch/SysMain is enabled
  • Windows 10 Pro 22H2

Biggest apps in memory are often: Firefox'es, Jetbrains Rider, Teams, VS Code, some DBMS.

How can it be my apps crash even when there is so much memory available?

=> this answer indicates lack of space to allow more commit from apps

Are there some OS tweaks to reduce the need for commit?
Or is it specific to each app?

SandRock
  • 562
  • 2
    Enable the page file. It is needed to fully enable virtual memory even when not used by any program. Programs over commit (allocate) memory that they do not necessarily use, and Windows honours every last byte of it and assumes it will all be used at some point in the future. That is the commit charge figure, memory allocated and given backing store (physical memory when the page file is disabled) but does not have "real" data in it. With the page file enabled those over allocations get given pages from the page file which end up in actual RAM if data is actually written to them. – Mokubai Oct 24 '23 at 11:24
  • Temporarily adding 1 GiB of page file made the memory use lower by ~7 GiB in less than a minute. There was almost no IO during that operation. How does that work? Is there some backing documentation about that? – SandRock Oct 24 '23 at 12:33

1 Answers1

4

You must enable the page file. Otherwise, you are wasting physical RAM for memory reservations programs made but do not use. You are not running out of memory, you are running out of commit limit.

From my answer on a related question:

[…] The page file is indispensable to make efficient use of physical memory. That’s because most programs reserve more memory than they will actually use (this is called “commit charge”). Windows does not allow “overcommitting” (making promises it may not be able to keep), so all reservations must be backed by physical memory or the page file.

In the screenshot, you can see that while only ~9 GiB of memory is used, 12 GiB are reserved in total.

Allow Windows to manage the page file size or, if you truly want to, invest some time to find the amount of memory your programs reserve and set that as the fixed size.

Daniel B
  • 62,883
  • Running with low available disk space, the page file option is not the greatest. Is there away to reduce the overcommit problem? Or to allow Windows to commit to unavailable memory space? – SandRock Oct 24 '23 at 12:18
  • Also, adding more RAM modules would help I suppose – SandRock Oct 24 '23 at 12:19
  • Before throwing money at more RAM, throw money at the smallest SSD you can buy. A 120 GB SSD is like $10. – Daniel B Oct 24 '23 at 12:33
  • I updated the question. Your answer provides some information but does not answers the question. May I ask for you to elaborate? – SandRock Oct 26 '23 at 17:47
  • I don’t see any major updates. You cannot change what applications do. You must have a page file. It will not cause “useless I/O” (or even any I/O) unless you actually run out of RAM. – Daniel B Oct 26 '23 at 17:57