[SOLVED] "System.OutOfMemoryException' was thrown" causing Monitors to black out?

Jan 21, 2022
12
0
10
I have a user whose monitors will randomly black out. The computer is still running, and when he inputs Winkey+ctrl+shift+B it restores the screens. The shortcut restarts the graphics drivers which leads me to believe it is a driver issue.

he will also occasionally receive a pop up saying "'System.OutOfMemoryException' was thrown".

if he restarts his computer a pop up reading "Unhandled exception has occurred in your application. There is an error in XML document (0.0)." shows.

I have tried reinstalling graphics drivers, and reinstalled windows but neither seemed to work.

here is a link to screenshots I have of the pop ups
 
Solution
i would check with dell and see if any new drivers, I still feel it might be a driver, maybe display drivers but only based on screen going black
it would show in event viewer or reliability history. might give a clue there.

I don't know how you would get this info without direct access to PC. Looking for a memory leak after the fact might be difficult.

it would help to know where the memory is being used. Is it ram or is it paged or non paged pool. Can you tell that info via the network? or ask user to take screenshot of task manager/performance ram tab.

there is a program called Poolmon that can be used to track memory leaks...

Colif

Win 11 Master
Moderator
what are specs of the PC?

In my experience, out of memory errors are normally caused by drivers. You can get them even if you have free ram
did you look at task manager when you get error? just curious if it shows high ram or paged/non paged pool usage.

this might be long but it explains it better than I can

it's important to understand what causes this problem. Contrary to what many developers believe, the amount of RAM that's installed doesn't impact the possibility of an OutOfMemoryException. A 32-bit operating system can address 4 GB of virtual address space, whatever the amount of physical memory that is installed in the box. Out of that, 2 GB is reserved for the operating system (Kernel-mode memory) and 2 GB is allocated to user-mode processes. The 2 GB allocated for Kernel-mode memory is shared among all processes, but each process gets its own 2 GB of user-mode address space. It all assumes that you aren't running with the /3gb switch enabled.

When an application needs to use memory, it reserves a chunk of the virtual address space and then commits memory from that chunk. It is exactly what the .NET Framework's garbage collector (GC) does when it needs memory to grow the managed heaps. When the GC needs a new segment for the small object heap (where objects smaller than 85 KB reside), it makes an allocation of 64 MB. When it needs a new segment for the large object heap, it makes an allocation of 16 MB. These large allocations must be satisfied from contiguous blocks of the 2 GB of address space that the process has to work with. If the operating system is unable to satisfy the GC's request for a contiguous block of memory, a System.OutOfMemoryException (OOM) occurs.

https://docs.microsoft.com/en-us/tr...performance/troubleshoot-outofmemoryexception

Seems to suggest its the application that is asking for commits but not releasing them?

What application is it? that might tell me more.
 
Jan 21, 2022
12
0
10
the computer is an Dell OptiPlex 3080 micro desktop.
unfortunately I only know about the incidents after they happen, so I can't reliably look at the task manager, but I do know that he always has Microsoft Outlook, Google Chrome (3+ tabs), Sage 100, and Ring Central open whenever he is working.
 

Colif

Win 11 Master
Moderator
i would check with dell and see if any new drivers, I still feel it might be a driver, maybe display drivers but only based on screen going black
it would show in event viewer or reliability history. might give a clue there.

I don't know how you would get this info without direct access to PC. Looking for a memory leak after the fact might be difficult.

it would help to know where the memory is being used. Is it ram or is it paged or non paged pool. Can you tell that info via the network? or ask user to take screenshot of task manager/performance ram tab.

there is a program called Poolmon that can be used to track memory leaks
.

normally show people this to show them how to do it:

Ideally I would run it at startup to get a baseline usage report and as either ram or page file usage increases, run the poolmon again and look at the tags with the biggest difference between Allocs and Frees. As these are the tags not releasing memory.

list of most of the tags - https://github.com/zodiacon/PoolMonXv2/blob/master/PoolMonX/res/pooltag.txt

generally, the area of memory used up is non paged pool. its area of ram used by drivers, they can't be paged out of memory hence areas name

Now you sort the Poolmon results by Non paged and look at non Microsoft tags. Some parts of windows will always have lots of ram as the processes in question manage ram.

Often the drivers that cause it the most are network drivers.
 
Last edited:
Solution
Jan 21, 2022
12
0
10
I reinstalled the graphics drivers to the latest version. It is usually a daily occurrence so I gave it a working day and there hasn't been an incident yet. I guess I just assumed that windows would automatically get the most recent drivers after I uninstalled the old one.