Wndows crash after running a program RRS feed

  • Question

  • My code uses CreateFileMapping to create three mapped files that are shared by many spawned processes.  Those processes all work properly and the answers are correct.

    But after running that sequence many times, I find that Windows has crashed.  If I open Thunderbird I see a black screen.  Closing and opening it again does nothing.  The Task Manager shows it still running, and if I terminate it there and try to open one more, it sometimes works but sometimes still shows a black screen.

    If I open Word and load a text file, it shows up black as well.  And the copy/paste operation no longer works anywhere.

    And the Start | Power | Restart does nothing.  I have to do a cold reboot.

    I have run the Dism cleanup options, which find nothing wrong, and sfc /Scannow finds nothing wrong.  And the Event Viewer shows no errors, even when this crash has occurred.

    Any ideas what is going on?

    Sunday, July 26, 2020 6:02 PM

All replies

  • You probably have a memory leak. Use task manager and check the values of the paged and non-paged pools while you run the tests.

    In the details tab add the handles column if its not there and click on it to sort it. See if some process has an excessive number.

    Sunday, July 26, 2020 11:03 PM
  • This is a great suggestion.  But how do I add the handles column?  I see no gadget for that.
    Tuesday, July 28, 2020 2:25 PM
  • Okay, I found how to show the column.  Here's what I see:

    Process 0 1264 handles

    Each spawned process 368

    I'm curious about how a memory leak could corrupt the OS.  I understand that if I allocate memory and fail to release it, that memory is not available to other processes.  But so what? When I'm running 18 processes, the memory usage is only 2% anyway.

    Is there any diagnostic that would show exactly what part of the OS is being corrupted?

    Tuesday, July 28, 2020 3:04 PM
  • Those handle counts looks ok. 

    There are certain area of memory that for lack of a better word, I'll call restricted. I don't claim to be an expert, but Mark Russinovich is. He is MS's internal guru and has written a number of articles on how Windows uses memory and how to monitor it.

    Technet is being decommisioned/archived/moved, so you may need to do some searching if links are bad. The articles were written for older versions of Windows but most of it still applies. 

    Are you using Visual Studio? Isn't there a memory analysis tool in that?

    I'd start with the Sysinternals tools, Process Explorer and Rammap.


    Tuesday, July 28, 2020 4:45 PM