Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Virtual RAM issue(event 2004)

GorweGorwe Member Posts: 1,609
edited June 2023 in Hardware
Hey, hey people. It's me again. This time with some sort of a RAM issue. Just to preempt, I've done: Windows memory tool scan, SFC, chkdsk and most other relevant things. I have NOT done Memtest though. If I were to do it, which one do you recommend? 64? 86? 86+? And this is the issue:

Sometimes when I play Unity games(Battlesector, Solasta), the game crashes with the Unity error window being visible shortly and the Windows Event Viewer says that the following happened:

"Resource-Exhaustion-Detector

Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory: AAAAAAA.exe consumed aaaaaaaa bytes, XXXXXX.exe consumed xxxxxxxxx bytes, and YYYY.exe  consumed yyyyyyyyyy bytes."

What's up with that? It only started happening recently ... oh there is one more thing you should know about:

When I manually sum up the RAM usage, it comes to the different number than the one that the computer reports. Can something be running in the background, in the invisible mode, idk? And about the cached RAM that takes up huge amount of space ... is that normal?

///

Thank you for your assistance!

Comments

  • VrikaVrika Member LegendaryPosts: 7,989
    That error message is used by Windows to tell you that something is taking so much memory that both your RAM and your cached RAM are full.

    The message should list three processes that consume most memory.

    Most likely your hardware and Windows are ok, but AAAAA.exe has memory leak or other problem that causes it to consume all your memory.
     
  • QuizzicalQuizzical Member LegendaryPosts: 25,499
    How much memory do those top programs use, and is it an unreasonably large amount?  If so, then you're probably looking at a game with some nasty memory leaks, as Vrika said.  You might be able to work around it somewhat by closing and restarting the game periodically.

    Does the game feel notably sluggish after a while?  That can mean that you're running out of memory and could benefit from adding more physical memory to your system.  Buying more memory to combat a game's memory leaks is not ideal, but you can't fix the memory leaks in someone else's game.
  • GorweGorwe Member Posts: 1,609
    Quizzical said:
    How much memory do those top programs use, and is it an unreasonably large amount?  If so, then you're probably looking at a game with some nasty memory leaks, as Vrika said.  You might be able to work around it somewhat by closing and restarting the game periodically.

    Does the game feel notably sluggish after a while?  That can mean that you're running out of memory and could benefit from adding more physical memory to your system.  Buying more memory to combat a game's memory leaks is not ideal, but you can't fix the memory leaks in someone else's game.
    No, they just crash and that event is logged. As for the unreasonably high amount, no, I wouldn't say so. And if I manually add up the RAM usage on top of idle usage, I still have 1-2 GB free left. Yet they crash.

    What's going on? And why does it show more RAM usage than it's shown by the visible processes?
  • VrikaVrika Member LegendaryPosts: 7,989
    edited June 2023
    Gorwe said:
    Quizzical said:
    How much memory do those top programs use, and is it an unreasonably large amount?  If so, then you're probably looking at a game with some nasty memory leaks, as Vrika said.  You might be able to work around it somewhat by closing and restarting the game periodically.

    Does the game feel notably sluggish after a while?  That can mean that you're running out of memory and could benefit from adding more physical memory to your system.  Buying more memory to combat a game's memory leaks is not ideal, but you can't fix the memory leaks in someone else's game.
    No, they just crash and that event is logged. As for the unreasonably high amount, no, I wouldn't say so. And if I manually add up the RAM usage on top of idle usage, I still have 1-2 GB free left. Yet they crash.

    What's going on? And why does it show more RAM usage than it's shown by the visible processes?
    How much are they using, can you post the aaa, xxx and yyy -bytes from the error message here?
    Post edited by Vrika on
     
  • GorweGorwe Member Posts: 1,609
    Vrika said:
    Gorwe said:
    Quizzical said:
    How much memory do those top programs use, and is it an unreasonably large amount?  If so, then you're probably looking at a game with some nasty memory leaks, as Vrika said.  You might be able to work around it somewhat by closing and restarting the game periodically.

    Does the game feel notably sluggish after a while?  That can mean that you're running out of memory and could benefit from adding more physical memory to your system.  Buying more memory to combat a game's memory leaks is not ideal, but you can't fix the memory leaks in someone else's game.
    No, they just crash and that event is logged. As for the unreasonably high amount, no, I wouldn't say so. And if I manually add up the RAM usage on top of idle usage, I still have 1-2 GB free left. Yet they crash.

    What's going on? And why does it show more RAM usage than it's shown by the visible processes?
    How much are they using, can you post the aaa, xxx and yyy -bytes from the error message here?

    Of course. Had to get to the computer first. Here are the precise numbers, wording, everything:

    "

    Event 2004: Resource-Exhaustion-Detector:

    Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory:
    Warhammer 40K Battlesector.exe (12968) consumed 5861097472 bytes, steamwebhelper.exe (7792) consumed 477024256 bytes and
    firefox.exe (12924) consumed 475238400 bytes.

    "

    As I said, that's like 7GB from the top 3 apps. If that. 7GB oou of 16GB surely shouldn't cause crashes and such. Unless I'm misunderstanding something.
  • olepiolepi Member EpicPosts: 3,053
    Gorwe said:
    Vrika said:
    Gorwe said:
    Quizzical said:
    How much memory do those top programs use, and is it an unreasonably large amount?  If so, then you're probably looking at a game with some nasty memory leaks, as Vrika said.  You might be able to work around it somewhat by closing and restarting the game periodically.

    Does the game feel notably sluggish after a while?  That can mean that you're running out of memory and could benefit from adding more physical memory to your system.  Buying more memory to combat a game's memory leaks is not ideal, but you can't fix the memory leaks in someone else's game.
    No, they just crash and that event is logged. As for the unreasonably high amount, no, I wouldn't say so. And if I manually add up the RAM usage on top of idle usage, I still have 1-2 GB free left. Yet they crash.

    What's going on? And why does it show more RAM usage than it's shown by the visible processes?
    How much are they using, can you post the aaa, xxx and yyy -bytes from the error message here?

    Of course. Had to get to the computer first. Here are the precise numbers, wording, everything:

    "

    Event 2004: Resource-Exhaustion-Detector:

    Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory:
    Warhammer 40K Battlesector.exe (12968) consumed 5861097472 bytes, steamwebhelper.exe (7792) consumed 477024256 bytes and
    firefox.exe (12924) consumed 475238400 bytes.

    "

    As I said, that's like 7GB from the top 3 apps. If that. 7GB oou of 16GB surely shouldn't cause crashes and such. Unless I'm misunderstanding something.

    If you bring up the task manager you will see a lot of processes. I have 98 background processes running Windows. Only 5 apps, and they use about 500mb total (no games). Still 40% of 32G is used.
    Gorwe

    ------------
    2024: 47 years on the Net.


  • GorweGorwe Member Posts: 1,609
    olepi said:
    Gorwe said:
    Vrika said:
    Gorwe said:
    Quizzical said:
    How much memory do those top programs use, and is it an unreasonably large amount?  If so, then you're probably looking at a game with some nasty memory leaks, as Vrika said.  You might be able to work around it somewhat by closing and restarting the game periodically.

    Does the game feel notably sluggish after a while?  That can mean that you're running out of memory and could benefit from adding more physical memory to your system.  Buying more memory to combat a game's memory leaks is not ideal, but you can't fix the memory leaks in someone else's game.
    No, they just crash and that event is logged. As for the unreasonably high amount, no, I wouldn't say so. And if I manually add up the RAM usage on top of idle usage, I still have 1-2 GB free left. Yet they crash.

    What's going on? And why does it show more RAM usage than it's shown by the visible processes?
    How much are they using, can you post the aaa, xxx and yyy -bytes from the error message here?

    Of course. Had to get to the computer first. Here are the precise numbers, wording, everything:

    "

    Event 2004: Resource-Exhaustion-Detector:

    Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory:
    Warhammer 40K Battlesector.exe (12968) consumed 5861097472 bytes, steamwebhelper.exe (7792) consumed 477024256 bytes and
    firefox.exe (12924) consumed 475238400 bytes.

    "

    As I said, that's like 7GB from the top 3 apps. If that. 7GB oou of 16GB surely shouldn't cause crashes and such. Unless I'm misunderstanding something.

    If you bring up the task manager you will see a lot of processes. I have 98 background processes running Windows. Only 5 apps, and they use about 500mb total (no games). Still 40% of 32G is used.

    Yeah, but they usually take up ~30-40% of those 16 GBs. If I add another 50%(8 GB) from Battlesector(or something else), there is still breathing room. That's why this interests me. Why would virtual memory be exhausted if I have another 20% RAM on hand(~2 GB)?
  • VrikaVrika Member LegendaryPosts: 7,989
    edited June 2023
    Gorwe said:
    Vrika said:
    Gorwe said:
    Quizzical said:
    How much memory do those top programs use, and is it an unreasonably large amount?  If so, then you're probably looking at a game with some nasty memory leaks, as Vrika said.  You might be able to work around it somewhat by closing and restarting the game periodically.

    Does the game feel notably sluggish after a while?  That can mean that you're running out of memory and could benefit from adding more physical memory to your system.  Buying more memory to combat a game's memory leaks is not ideal, but you can't fix the memory leaks in someone else's game.
    No, they just crash and that event is logged. As for the unreasonably high amount, no, I wouldn't say so. And if I manually add up the RAM usage on top of idle usage, I still have 1-2 GB free left. Yet they crash.

    What's going on? And why does it show more RAM usage than it's shown by the visible processes?
    How much are they using, can you post the aaa, xxx and yyy -bytes from the error message here?

    Of course. Had to get to the computer first. Here are the precise numbers, wording, everything:

    "

    Event 2004: Resource-Exhaustion-Detector:

    Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory:
    Warhammer 40K Battlesector.exe (12968) consumed 5861097472 bytes, steamwebhelper.exe (7792) consumed 477024256 bytes and
    firefox.exe (12924) consumed 475238400 bytes.

    "

    As I said, that's like 7GB from the top 3 apps. If that. 7GB oou of 16GB surely shouldn't cause crashes and such. Unless I'm misunderstanding something.
    You're right. That memory usage shouldn't cause crash if you've got 16 GB of RAM.

    What does the memory info on Task Manager look like?

    You'll get memory info if from task manager you select Performance, then select Memory. It should look something like this:



    In Use and Available tells you the physical memory consumption.

    Below those committed tells you total memory consumption, including RAM data stored on page file on your hard drive. The first number is how much memory is committed, and the second number is how much can be committed.

    Below those the Paged Pool and Non-paged Pool tell about Window's kernel's memory usage. Those numbers should be relatively low.

    What are the numbers for Committed, Paged Pool and Non-paged pool?

    It would be best if you check them once when you've just started playing, then second time after you've played for a while to see if something is causing one of them to constantly increase during gameplay.
     
  • GorweGorwe Member Posts: 1,609
    edited June 2023
    Vrika said:
    Gorwe said:
    Vrika said:
    Gorwe said:
    Quizzical said:
    How much memory do those top programs use, and is it an unreasonably large amount?  If so, then you're probably looking at a game with some nasty memory leaks, as Vrika said.  You might be able to work around it somewhat by closing and restarting the game periodically.

    Does the game feel notably sluggish after a while?  That can mean that you're running out of memory and could benefit from adding more physical memory to your system.  Buying more memory to combat a game's memory leaks is not ideal, but you can't fix the memory leaks in someone else's game.
    No, they just crash and that event is logged. As for the unreasonably high amount, no, I wouldn't say so. And if I manually add up the RAM usage on top of idle usage, I still have 1-2 GB free left. Yet they crash.

    What's going on? And why does it show more RAM usage than it's shown by the visible processes?
    How much are they using, can you post the aaa, xxx and yyy -bytes from the error message here?

    Of course. Had to get to the computer first. Here are the precise numbers, wording, everything:

    "

    Event 2004: Resource-Exhaustion-Detector:

    Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory:
    Warhammer 40K Battlesector.exe (12968) consumed 5861097472 bytes, steamwebhelper.exe (7792) consumed 477024256 bytes and
    firefox.exe (12924) consumed 475238400 bytes.

    "

    As I said, that's like 7GB from the top 3 apps. If that. 7GB oou of 16GB surely shouldn't cause crashes and such. Unless I'm misunderstanding something.
    You're right. That memory usage shouldn't cause crash if you've got 16 GB of RAM.

    What does the memory info on Task Manager look like?

    You'll get memory info if from task manager you select Performance, then select Memory. It should look something like this:



    In Use and Available tells you the physical memory consumption.

    Below those committed tells you total memory consumption, including RAM data stored on page file on your hard drive. The first number is how much memory is committed, and the second number is how much can be committed.

    Below those the Paged Pool and Non-paged Pool tell about Window's kernel's memory usage. Those numbers should be relatively low.

    What are the numbers for Committed, Paged Pool and Non-paged pool?

    It would be best if you check them once when you've just started playing, then second time after you've played for a while to see if something is causing one of them to constantly increase during gameplay.

    Something's suckling on my RAM. Now I physically wrote down the ram usage and the processes / services that use it and ... End Task Mngr is ... ~17,5% off! 17,5%!!! I really need to see all the apps / procs / svcs running ... any way except End Task Mngr?

    Regardless, as for what you asked me to do: With only Firefox active, it is:

    In Use(Compressed): 4,1 GB (125MB)

    Commited: 7,3 / 16,4 GB

    Cached: 6,9 GB

    Paged Pool: 383 MB

    Non-Paged Pool: 250 MB

    Available: 11,7 GB (huh?)

    With Steam + Firefox:

    In Use(Compressed): 4,9 GB (125MB)

    Commited: 8,3 / 16,4 GB

    Cached: 7,5 GB

    Paged: 391 MB

    Non-Paged: 253 MB

    Available: 11 GB

    (a funny thing: when I woke up my computer, it was at 60% RAM usage! What gives?)
  • VrikaVrika Member LegendaryPosts: 7,989
    edited June 2023
    Gorwe said:
    Vrika said:
    You're right. That memory usage shouldn't cause crash if you've got 16 GB of RAM.

    What does the memory info on Task Manager look like?

    You'll get memory info if from task manager you select Performance, then select Memory. It should look something like this:



    In Use and Available tells you the physical memory consumption.

    Below those committed tells you total memory consumption, including RAM data stored on page file on your hard drive. The first number is how much memory is committed, and the second number is how much can be committed.

    Below those the Paged Pool and Non-paged Pool tell about Window's kernel's memory usage. Those numbers should be relatively low.

    What are the numbers for Committed, Paged Pool and Non-paged pool?

    It would be best if you check them once when you've just started playing, then second time after you've played for a while to see if something is causing one of them to constantly increase during gameplay.

    Something's suckling on my RAM. Now I physically wrote down the ram usage and the processes / services that use it and ... End Task Mngr is ... ~17,5% off! 17,5%!!! I really need to see all the apps / procs / svcs running ... any way except End Task Mngr?

    Regardless, as for what you asked me to do: With only Firefox active, it is:

    In Use(Compressed): 4,1 GB (125MB)

    Commited: 7,3 / 16,4 GB

    Cached: 6,9 GB

    Paged Pool: 383 MB

    Non-Paged Pool: 250 MB

    Available: 11,7 GB (huh?)

    With Steam + Firefox:

    In Use(Compressed): 4,9 GB (125MB)

    Commited: 8,3 / 16,4 GB

    Cached: 7,5 GB

    Paged: 391 MB

    Non-Paged: 253 MB

    Available: 11 GB

    (a funny thing: when I woke up my computer, it was at 60% RAM usage! What gives?)



    The available that you've written (huh?) after looks like it should: In Use + Available should tell the total physical RAM on your computer, and based on that it's 4,1 GB + 11,7 GB, which would equal to 15,8 GB.

    The usable physical memory is always a bit smaller than actual memory size. So if you've got 16 GB of RAM, and In Use + Available is total of 15,8 GB, that looks like it should.


    If your computer is already at 60% usage when it wakes up, I'd restart it. By default Windows 11 never performs full shutdown and boot-up process unless you manually select Restart from the power menu. Making it do the full process could give you smaller RAM usage at start-up. Then try other stuff only if restarting doesn't help.


    If you want another way to look at memory usage besides task manager, you can try Resource Monitor. Assuming that you're using Win 11, just write Resource Monitor to the search box and Windows should find it for you. Though I don't know if you can really see everything that's using memory and get those numbers correctly with that either, Window's memory management is complicated and I've never tried to get the numbers add up like that.


    But with all that said, could you look at those memory stats while you're running the game that causes crashes. Preferably look once when you've just started playing, then second time after you've played for a while to check whether those numbers change a lot during gameplay.

    It would be ideal to look at memory usage right before the game crashes, but since that's often hard to achieve, the aim is to at least look with same programs running as you've got when they crash.


    EDIT: Also question, do you have free space on your Windows installation drive? Based on those Committed -values your Windows is using only about 600 MB page file. Windows should automatically increase the page file size when your physical RAM gets too full, but it needs to have free hard disk space to do so. Which means if the hard disk Windows is installed on is completely full of stuff, that could be causing your memory exhaustion errors.
     
  • GorweGorwe Member Posts: 1,609
    edited June 2023
    Vrika said:
    Gorwe said:
    Vrika said:
    You're right. That memory usage shouldn't cause crash if you've got 16 GB of RAM.

    What does the memory info on Task Manager look like?

    You'll get memory info if from task manager you select Performance, then select Memory. It should look something like this:



    In Use and Available tells you the physical memory consumption.

    Below those committed tells you total memory consumption, including RAM data stored on page file on your hard drive. The first number is how much memory is committed, and the second number is how much can be committed.

    Below those the Paged Pool and Non-paged Pool tell about Window's kernel's memory usage. Those numbers should be relatively low.

    What are the numbers for Committed, Paged Pool and Non-paged pool?

    It would be best if you check them once when you've just started playing, then second time after you've played for a while to see if something is causing one of them to constantly increase during gameplay.

    Something's suckling on my RAM. Now I physically wrote down the ram usage and the processes / services that use it and ... End Task Mngr is ... ~17,5% off! 17,5%!!! I really need to see all the apps / procs / svcs running ... any way except End Task Mngr?

    Regardless, as for what you asked me to do: With only Firefox active, it is:

    In Use(Compressed): 4,1 GB (125MB)

    Commited: 7,3 / 16,4 GB

    Cached: 6,9 GB

    Paged Pool: 383 MB

    Non-Paged Pool: 250 MB

    Available: 11,7 GB (huh?)

    With Steam + Firefox:

    In Use(Compressed): 4,9 GB (125MB)

    Commited: 8,3 / 16,4 GB

    Cached: 7,5 GB

    Paged: 391 MB

    Non-Paged: 253 MB

    Available: 11 GB

    (a funny thing: when I woke up my computer, it was at 60% RAM usage! What gives?)



    The available that you've written (huh?) after looks like it should: In Use + Available should tell the total physical RAM on your computer, and based on that it's 4,1 GB + 11,7 GB, which would equal to 15,8 GB.

    The usable physical memory is always a bit smaller than actual memory size. So if you've got 16 GB of RAM, and In Use + Available is total of 15,8 GB, that looks like it should.


    If your computer is already at 60% usage when it wakes up, I'd restart it. By default Windows 11 never performs full shutdown and boot-up process unless you manually select Restart from the power menu. Making it do the full process could give you smaller RAM usage at start-up. Then try other stuff only if restarting doesn't help.


    If you want another way to look at memory usage besides task manager, you can try Resource Monitor. Assuming that you're using Win 11, just write Resource Monitor to the search box and Windows should find it for you. Though I don't know if you can really see everything that's using memory and get those numbers correctly with that either, Window's memory management is complicated and I've never tried to get the numbers add up like that.


    But with all that said, could you look at those memory stats while you're running the game that causes crashes. Preferably look once when you've just started playing, then second time after you've played for a while to check whether those numbers change a lot during gameplay.

    It would be ideal to look at memory usage right before the game crashes, but since that's often hard to achieve, the aim is to at least look with same programs running as you've got when they crash.


    EDIT: Also question, do you have free space on your Windows installation drive? Based on those Committed -values your Windows is using only about 600 MB page file. Windows should automatically increase the page file size when your physical RAM gets too full, but it needs to have free hard disk space to do so. Which means if the hard disk Windows is installed on is completely full of stuff, that could be causing your memory exhaustion errors.
    How much space are we talking about? I am also curious whether I have Fast Startup enabled. If so, it's going the way of dodo. I want to clear my RAM when I shut down my PC, damn it! No writing to OS disc then awkward reloading or what have you.
    Post edited by Gorwe on
  • QuizzicalQuizzical Member LegendaryPosts: 25,499
    It doesn't say that you're running out of physical memory.  It says that you're running out of virtual memory.

    There are two different ways that memory gets divided here that are relevant.  One is the difference between physical memory and cached memory.  The latter is space on your disk that the operating system can treat as memory, though it's really slow to access, even with an SSD.

    The other is the difference between memory allocated and memory actually used.  It is common for programs to allocate a bunch of memory and then not use it, or at least, not use all of it.  Task Manager only shows you the amount of memory that a program is actually using, and not what it has allocated but is not using.

    To see the latter, you'll have to open up Resource Monitor.  At least in Windows 10, you can go to the Performance tab, then click the "Open Resource Monitor" link at the bottom.  The Memory tab will show you separate columns for "Working Set" (memory actually in use) and Commit (memory allocated but not used), among other things.

    The problem is that the total amount of memory allocated (used plus not used, or in the above terminology, "Working Set" plus "Commit") has to be less than the total amount of memory available, as physical memory plus cached memory.  If you run out, then when a program tries to allocate more memory, the allocation will fail, as Windows will say, I don't have anywhere to put it.  And if a memory allocation fails, then the best that a program can do is to give a useful error message and shut down cleanly.

    So why are you running out?  One possibility is that you're using a ridiculous amount of virtual memory.  It looks like no particular program is doing anything all that egregious.  It is common for games to use a lot, as when they try to allocate memory on a GPU, the video driver will commonly claim that same amount as host memory.  It is theoretically possible to have a very large number of programs all using a moderate amount of virtual memory, and cause trouble that way, but it's pretty unlikely to happen by accident.

    Another possibility is that Windows would like to claim more disk space as cached memory, but can't.  By default, Windows will automatically adjust your maximum amount of cached memory and increase it as needed up to a pretty large limit.  There are two things that can prevent this.  One is if you've changed settings to tell it that it isn't allowed to do so.  The other is if you're running out of disk space so that there isn't more space on your hard drive (or I hope, SSD) to claim as cached memory.

    Check your SSD or whatever Windows is installed to see how much free space you have.  A general guideline is that you want to allow Windows to claim at least 1.5 times your amount of physical DRAM as cached memory.  If your drive is nearly full, then it can't do that and may be liable to run out.

    After writing most of this post, I see that Vrika has said much of the same stuff.  Oh well.  I'll post it anyway.
    Gorwe
  • GorweGorwe Member Posts: 1,609
    edited June 2023
    Quizzical said:
    It doesn't say that you're running out of physical memory.  It says that you're running out of virtual memory.

    There are two different ways that memory gets divided here that are relevant.  One is the difference between physical memory and cached memory.  The latter is space on your disk that the operating system can treat as memory, though it's really slow to access, even with an SSD.

    The other is the difference between memory allocated and memory actually used.  It is common for programs to allocate a bunch of memory and then not use it, or at least, not use all of it.  Task Manager only shows you the amount of memory that a program is actually using, and not what it has allocated but is not using.

    To see the latter, you'll have to open up Resource Monitor.  At least in Windows 10, you can go to the Performance tab, then click the "Open Resource Monitor" link at the bottom.  The Memory tab will show you separate columns for "Working Set" (memory actually in use) and Commit (memory allocated but not used), among other things.

    The problem is that the total amount of memory allocated (used plus not used, or in the above terminology, "Working Set" plus "Commit") has to be less than the total amount of memory available, as physical memory plus cached memory.  If you run out, then when a program tries to allocate more memory, the allocation will fail, as Windows will say, I don't have anywhere to put it.  And if a memory allocation fails, then the best that a program can do is to give a useful error message and shut down cleanly.

    So why are you running out?  One possibility is that you're using a ridiculous amount of virtual memory.  It looks like no particular program is doing anything all that egregious.  It is common for games to use a lot, as when they try to allocate memory on a GPU, the video driver will commonly claim that same amount as host memory.  It is theoretically possible to have a very large number of programs all using a moderate amount of virtual memory, and cause trouble that way, but it's pretty unlikely to happen by accident.

    Another possibility is that Windows would like to claim more disk space as cached memory, but can't.  By default, Windows will automatically adjust your maximum amount of cached memory and increase it as needed up to a pretty large limit.  There are two things that can prevent this.  One is if you've changed settings to tell it that it isn't allowed to do so.  The other is if you're running out of disk space so that there isn't more space on your hard drive (or I hope, SSD) to claim as cached memory.

    Check your SSD or whatever Windows is installed to see how much free space you have.  A general guideline is that you want to allow Windows to claim at least 1.5 times your amount of physical DRAM as cached memory.  If your drive is nearly full, then it can't do that and may be liable to run out.

    After writing most of this post, I see that Vrika has said much of the same stuff.  Oh well.  I'll post it anyway.
    I have ~60GB free. But sometimes a huge amount of the RAM falls into a cached category(dark blue bar in the Resource Monitor). Like 6GB+. Maybe it has something to do with that?

    Regardless, what are your suggestions? Most notably about that disparity in memory usage. That's a thing that really interests me. Why does that happen?
  • QuizzicalQuizzical Member LegendaryPosts: 25,499
    Gorwe said:
    Quizzical said:
    It doesn't say that you're running out of physical memory.  It says that you're running out of virtual memory.

    There are two different ways that memory gets divided here that are relevant.  One is the difference between physical memory and cached memory.  The latter is space on your disk that the operating system can treat as memory, though it's really slow to access, even with an SSD.

    The other is the difference between memory allocated and memory actually used.  It is common for programs to allocate a bunch of memory and then not use it, or at least, not use all of it.  Task Manager only shows you the amount of memory that a program is actually using, and not what it has allocated but is not using.

    To see the latter, you'll have to open up Resource Monitor.  At least in Windows 10, you can go to the Performance tab, then click the "Open Resource Monitor" link at the bottom.  The Memory tab will show you separate columns for "Working Set" (memory actually in use) and Commit (memory allocated but not used), among other things.

    The problem is that the total amount of memory allocated (used plus not used, or in the above terminology, "Working Set" plus "Commit") has to be less than the total amount of memory available, as physical memory plus cached memory.  If you run out, then when a program tries to allocate more memory, the allocation will fail, as Windows will say, I don't have anywhere to put it.  And if a memory allocation fails, then the best that a program can do is to give a useful error message and shut down cleanly.

    So why are you running out?  One possibility is that you're using a ridiculous amount of virtual memory.  It looks like no particular program is doing anything all that egregious.  It is common for games to use a lot, as when they try to allocate memory on a GPU, the video driver will commonly claim that same amount as host memory.  It is theoretically possible to have a very large number of programs all using a moderate amount of virtual memory, and cause trouble that way, but it's pretty unlikely to happen by accident.

    Another possibility is that Windows would like to claim more disk space as cached memory, but can't.  By default, Windows will automatically adjust your maximum amount of cached memory and increase it as needed up to a pretty large limit.  There are two things that can prevent this.  One is if you've changed settings to tell it that it isn't allowed to do so.  The other is if you're running out of disk space so that there isn't more space on your hard drive (or I hope, SSD) to claim as cached memory.

    Check your SSD or whatever Windows is installed to see how much free space you have.  A general guideline is that you want to allow Windows to claim at least 1.5 times your amount of physical DRAM as cached memory.  If your drive is nearly full, then it can't do that and may be liable to run out.

    After writing most of this post, I see that Vrika has said much of the same stuff.  Oh well.  I'll post it anyway.
    I have ~60GB free. But sometimes a huge amount of the RAM falls into a cached category(dark blue bar in the Resource Monitor). Like 6GB+. Maybe it has something to do with that?

    Regardless, what are your suggestions? Most notably about that disparity in memory usage. That's a thing that really interests me. Why does that happen?
    If your question is why programs allocate memory and then don't use it, then there are a lot of reasons.  I'll give you one example of how it can happen.

    Suppose that a programmer needs to have a list of numbers for some reason, but doesn't know how many numbers are going to be on the list.  Maybe it's a list of players in one zone of a game, which is constantly changing as players move around.

    You have to allocate enough space for all of the numbers that will be in the list.  If you try to write an extra number past the end of the list, then something bad will happen, such as the program crashing.  You could, in principle, allocate just enough for what you need, and then if you need space for one more, reallocate space for a slightly larger list and then copy over the previous list.  This can get really slow, however, as it could mean doing about a trillion copy operations to create a list of only a million numbers.

    Sometimes a programmer will say, here, I'll just estimate high and allocate what I'm certain is more space than I'll actually need.  If I think that I'll need about 2-3 MB of space and will probably never need more than 4 MB, then I'll allocate 8 MB and be pretty sure that I'll never run out.  If nothing gets written to memory past the first 3 MB, then Windows will figure out that the other 5 MB is unused.

    That's pretty sloppy, but a better approach is to use the container classes that a lot of programming languages offer.  For example, you could have a std::vector in C++, an ArrayList in Java, and so forth.  The idea there is that when you create the list, it will start by allocating a small amount of memory, and give you a function to append something to the end of the list.  Every time you append something, it will check to see if it has enough space.  If so, then it just appends the number at the end of the list.  If not, then it will automatically allocate space for a new list that is double the size of the old, copy the old data to the new list, and then free the memory for the old list.

    Doubling the size every time you have to reallocate more memory means a lot less copying data around.  The number of copy operations can be at most the amount of memory allocated for the list.  And it doesn't waste as much memory as if you just estimated way too high and left it at that.  But it often still wastes a lot of memory, as if you're just a little past the threshold to reallocate a larger buffer, nearly half of your array is unused memory.

    And that's for a good programming practice where the programmer isn't just being sloppy.  If you're using some off the shelf game engine that you don't understand very well, the game engine may be automatically reserving a bunch of memory for things that the programmer will never use and doesn't realize that it's even there.  Tools that call other tools that call other tools that call other tools often end up being wasteful in convoluted ways.
  • QuizzicalQuizzical Member LegendaryPosts: 25,499
    Check how much virtual memory you're allowing Windows to use.  A search engine can surely find sites that explain how to check and adjust that.  If you're manually set it to something too low, then that could be the problem.  Alternatively, you might be able to fix your problem just by manually increasing the cap.
  • GorweGorwe Member Posts: 1,609
    edited June 2023
    Quizzical said:
    Check how much virtual memory you're allowing Windows to use.  A search engine can surely find sites that explain how to check and adjust that.  If you're manually set it to something too low, then that could be the problem.  Alternatively, you might be able to fix your problem just by manually increasing the cap.
    Yeah, but why did that start now? What changed lol?

    My question was: "why does task mngr(and the like) report more RAM usage than it's actually visible?".
  • VrikaVrika Member LegendaryPosts: 7,989
    edited June 2023
    Gorwe said:
    Quizzical said:
    Check how much virtual memory you're allowing Windows to use.  A search engine can surely find sites that explain how to check and adjust that.  If you're manually set it to something too low, then that could be the problem.  Alternatively, you might be able to fix your problem just by manually increasing the cap.
    Yeah, but why did that start now? What changed lol?

    My question was: "why does task mngr(and the like) report more RAM usage than it's actually visible?".
    Window's memory use is complicated. The short answers to that question are:
     -OS needs some background stuff that is not part of any process to function
     -Unused memory doesn't benefit anything, so the OS is designed to use extra RAM for stuff like keeping some files from hard disk in RAM for easy access. I don't know how all this extra is calculated in task manager, since the OS is designed to free a lot of that for other purposes if the computer runs low on physical memory

    For long answer, I think you can find more info with tool like RAMMap
      https://techcommunity.microsoft.com/t5/ask-the-performance-team/introduction-to-the-new-sysinternals-tool-rammap/ba-p/374717
     
  • QuizzicalQuizzical Member LegendaryPosts: 25,499
    Gorwe said:
    Quizzical said:
    Check how much virtual memory you're allowing Windows to use.  A search engine can surely find sites that explain how to check and adjust that.  If you're manually set it to something too low, then that could be the problem.  Alternatively, you might be able to fix your problem just by manually increasing the cap.
    Yeah, but why did that start now? What changed lol?

    My question was: "why does task mngr(and the like) report more RAM usage than it's actually visible?".
    Another common use of memory is prefetching.  The idea is that Windows will see that you have a bunch of memory that isn't being used, but so it will try to guess what you're going to load next, and then load it into memory before you ask for it.  For example, if you manually launch a particular game nearly every day, then when you boot your computer, it will load that game into memory without waiting for you to launch it.  It will only do that if you have spare memory that isn't being used, and if something else needs the memory, then it will drop the prefetched data to make space.

    Does that count as memory in use?  It depends on which total you look at.  Windows Vista made it count toward the most visible memory total, which confused a lot of people.  That's why subsequent versions of Windows made it not count toward the most visible total, though I'm sure that it's still displayed somewhere if you look for it.

    Similarly, does memory that has been allocated but not yet used count as memory in use?  It again depends on which total you look at.

    As for what changed, a lot of things could have changed.  Maybe you play a game now that uses more memory than others that you've played in the past.  Maybe you like to have more things running in the background than you used to.  Maybe you have malware running in the background and using a bunch of memory.  Maybe a program that you've used for a long time updated and the new version uses a lot more memory than the old.  I don't know what changed, but unless it's one huge thing, it will probably be impractical to track down.
    Gorwe
  • VrikaVrika Member LegendaryPosts: 7,989
    edited June 2023
    Gorwe said:

     I am also curious whether I have Fast Startup enabled. If so, it's going the way of dodo. I want to clear my RAM when I shut down my PC, damn it! No writing to OS disc then awkward reloading or what have you.
    If you want to disable fast start up, go to:

    Control Panel
     -> Hardware and Sound
     -> Change What The Power Buttons Do (under Power Options)
     
    From there you'll find checkbox for "Turn on fast start-up". You'll need to click "Change settings that are currently unavailable" before you're able to change it.

    If fast start-up is turned on the computer shuts down all programs and then places the OS to hibernation when you shut the computer down. When fast start-up is turned off, the OS shuts all programs and then itself when you shut down.
     
  • VrikaVrika Member LegendaryPosts: 7,989
    edited June 2023
    Quizzical said:
    Check how much virtual memory you're allowing Windows to use.  A search engine can surely find sites that explain how to check and adjust that.  If you're manually set it to something too low, then that could be the problem.  Alternatively, you might be able to fix your problem just by manually increasing the cap.
    You can see the virtual memory from

    Settings
     -> System
     -> About (it's located on the bottom of the list)
     -> Advanced System Settings
     -> Performance Settings (you need to click button labeled "Settings" inside the "Performance" -box. There are three buttons labeled "Settings" on that same screen, be careful to pick the one inside correct box)
     -> Advanced (from the tab selection menu at top)

    From there you find the button to change virtual memory. If you have right now very small page file and 60 GB free disk space, you might want to check whether doing something like setting the page file temporarily to 40000MB (about 40 GB) would fix your problem. Just remember to revert that setting after checking to free up the used hard disk space.

    Though I still think it'd be a good idea to check what the committed, paged pool and non-paged pool look like when running the game before trying any fixes.
     
  • GorweGorwe Member Posts: 1,609
    edited June 2023
    Quizzical said:
    Gorwe said:
    Quizzical said:
    Check how much virtual memory you're allowing Windows to use.  A search engine can surely find sites that explain how to check and adjust that.  If you're manually set it to something too low, then that could be the problem.  Alternatively, you might be able to fix your problem just by manually increasing the cap.
    Yeah, but why did that start now? What changed lol?

    My question was: "why does task mngr(and the like) report more RAM usage than it's actually visible?".
    Another common use of memory is prefetching.  The idea is that Windows will see that you have a bunch of memory that isn't being used, but so it will try to guess what you're going to load next, and then load it into memory before you ask for it.  For example, if you manually launch a particular game nearly every day, then when you boot your computer, it will load that game into memory without waiting for you to launch it.  It will only do that if you have spare memory that isn't being used, and if something else needs the memory, then it will drop the prefetched data to make space.

    Does that count as memory in use?  It depends on which total you look at.  Windows Vista made it count toward the most visible memory total, which confused a lot of people.  That's why subsequent versions of Windows made it not count toward the most visible total, though I'm sure that it's still displayed somewhere if you look for it.

    Similarly, does memory that has been allocated but not yet used count as memory in use?  It again depends on which total you look at.

    As for what changed, a lot of things could have changed.  Maybe you play a game now that uses more memory than others that you've played in the past.  Maybe you like to have more things running in the background than you used to.  Maybe you have malware running in the background and using a bunch of memory.  Maybe a program that you've used for a long time updated and the new version uses a lot more memory than the old.  I don't know what changed, but unless it's one huge thing, it will probably be impractical to track down.
    Thank you for everything! Got any advice on picking anti-virus or security suite? Or any to recommend for that matter.
  • GorweGorwe Member Posts: 1,609
    edited June 2023
    Quizzical said:
    Gorwe said:
    Quizzical said:
    Check how much virtual memory you're allowing Windows to use.  A search engine can surely find sites that explain how to check and adjust that.  If you're manually set it to something too low, then that could be the problem.  Alternatively, you might be able to fix your problem just by manually increasing the cap.
    Yeah, but why did that start now? What changed lol?

    My question was: "why does task mngr(and the like) report more RAM usage than it's actually visible?".
    Another common use of memory is prefetching.  The idea is that Windows will see that you have a bunch of memory that isn't being used, but so it will try to guess what you're going to load next, and then load it into memory before you ask for it.  For example, if you manually launch a particular game nearly every day, then when you boot your computer, it will load that game into memory without waiting for you to launch it.  It will only do that if you have spare memory that isn't being used, and if something else needs the memory, then it will drop the prefetched data to make space.

    Does that count as memory in use?  It depends on which total you look at.  Windows Vista made it count toward the most visible memory total, which confused a lot of people.  That's why subsequent versions of Windows made it not count toward the most visible total, though I'm sure that it's still displayed somewhere if you look for it.

    Similarly, does memory that has been allocated but not yet used count as memory in use?  It again depends on which total you look at.

    As for what changed, a lot of things could have changed.  Maybe you play a game now that uses more memory than others that you've played in the past.  Maybe you like to have more things running in the background than you used to.  Maybe you have malware running in the background and using a bunch of memory.  Maybe a program that you've used for a long time updated and the new version uses a lot more memory than the old.  I don't know what changed, but unless it's one huge thing, it will probably be impractical to track down.

    Here it is again. 40% RAM usage while I was gone. And the same thing is at the top that was when it was 60%+:

    Steam Client WebHelper

    That reminds me: Why are there multiple instances of the same app / proc / svc running concurrently? I see at least two Steam Client Web Helpers, for example.

    EDIT: Wait, what? Didn't do a thing and it's now at 25% usage? Where did the Steam Client WebHelper RAM usage go(went from 2GB to 250MB)? What's going on?
    Post edited by Gorwe on
  • QuizzicalQuizzical Member LegendaryPosts: 25,499
    Gorwe said:
    Quizzical said:
    Gorwe said:
    Quizzical said:
    Check how much virtual memory you're allowing Windows to use.  A search engine can surely find sites that explain how to check and adjust that.  If you're manually set it to something too low, then that could be the problem.  Alternatively, you might be able to fix your problem just by manually increasing the cap.
    Yeah, but why did that start now? What changed lol?

    My question was: "why does task mngr(and the like) report more RAM usage than it's actually visible?".
    Another common use of memory is prefetching.  The idea is that Windows will see that you have a bunch of memory that isn't being used, but so it will try to guess what you're going to load next, and then load it into memory before you ask for it.  For example, if you manually launch a particular game nearly every day, then when you boot your computer, it will load that game into memory without waiting for you to launch it.  It will only do that if you have spare memory that isn't being used, and if something else needs the memory, then it will drop the prefetched data to make space.

    Does that count as memory in use?  It depends on which total you look at.  Windows Vista made it count toward the most visible memory total, which confused a lot of people.  That's why subsequent versions of Windows made it not count toward the most visible total, though I'm sure that it's still displayed somewhere if you look for it.

    Similarly, does memory that has been allocated but not yet used count as memory in use?  It again depends on which total you look at.

    As for what changed, a lot of things could have changed.  Maybe you play a game now that uses more memory than others that you've played in the past.  Maybe you like to have more things running in the background than you used to.  Maybe you have malware running in the background and using a bunch of memory.  Maybe a program that you've used for a long time updated and the new version uses a lot more memory than the old.  I don't know what changed, but unless it's one huge thing, it will probably be impractical to track down.

    Here it is again. 40% RAM usage while I was gone. And the same thing is at the top that was when it was 60%+:

    Steam Client WebHelper

    That reminds me: Why are there multiple instances of the same app / proc / svc running concurrently? I see at least two Steam Client Web Helpers, for example.

    EDIT: Wait, what? Didn't do a thing and it's now at 25% usage? Where did the Steam Client WebHelper RAM usage go(went from 2GB to 250MB)? What's going on?
    Some "programs" will split themselves into multiple processes for a variety of reasons.  One reason to do this is for resilience, so that one process dying doesn't kill the rest.  In some cases, a surviving process can even see that another one died and restart it.

    I think that the clearest example of this being useful is web browsers using a different process for each browser tab.  That way, if some rogue web site causes something to crash, it doesn't kill the browser entirely.  Rather, you can just close the offending tab, while the rest of your browser tabs are fine.

    I don't know what exactly Steam was doing.  One possibility is that it was updating some game in the background, since the computer was largely idle.  That could temporarily use a lot of memory, which is what you observed.
Sign In or Register to comment.