locked
"Out of memory" occationally

    Question

  • My app uses (according to task manager) ~100MB of memory, yet Windows sometimes switches to the desktop and displays an OOM message box. I can switch back to the app and its still running just fine. It was neither suspended nor terminated.

    What could be the reason?

    Wednesday, November 19, 2014 9:57 AM

Answers

  • The actual displayed dialog box is: "Zu wenig Speicher..Bitte beenden Sie die Anwendung!".  The reason you're seeing the message is because it's likely wrong. The message box appears because the third-party api you're using makes it appear.  An actual OOM would crash the process, or force a Windows OS dialog box to appear. 

    There's a big difference between physical RAM used and virtual memory space.  32-bit processes running on x64 machines can use up to 4Gb of virtual memory space and this space is unaffected by other processes running on the same machine.  This app does not appear to know the difference.  I would ask the vendor to provide a version which doesn't throw these messages, or at least, explain when it decides to throw that message so you can try to code around it.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


    Monday, December 15, 2014 4:43 PM
    Moderator

All replies

  • Are you sure the OOM message is for that app? An OOM app is going to crash since it can't allocate any more memory for necessary functions.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, November 19, 2014 3:40 PM
    Moderator
  • I am not sure, since the Windows does not specify which app it is. However its title says wwahost.exe and there was only one wwahost.exe running at the moment the message appeared.

    Should this be visible in the system event log?

    Wednesday, November 19, 2014 3:43 PM
  • Capture a dump of wwwhost.exe when this occurs for analysis.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, November 19, 2014 7:44 PM
    Moderator
  • And how would I do that?
    Wednesday, November 19, 2014 7:48 PM
  • Right-click on wwahost.exe in task manager -> create dump file.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, November 19, 2014 8:26 PM
    Moderator
  • I have created a dump file http://1drv.ms/1xDUIwO. The error occurred when I started an Oracle VM instance that needed 2GB ram. My app was consuming ~100 at that moment (during the dumping process this grew to 200MB and never went back). The app was still running after I clicked "OK" in the error dialog. I guess thats because it was started with the VS debugger attached.

    So what can we see in the dump file?

    Tuesday, December 9, 2014 10:15 AM
  • The actual displayed dialog box is: "Zu wenig Speicher..Bitte beenden Sie die Anwendung!".  The reason you're seeing the message is because it's likely wrong. The message box appears because the third-party api you're using makes it appear.  An actual OOM would crash the process, or force a Windows OS dialog box to appear. 

    There's a big difference between physical RAM used and virtual memory space.  32-bit processes running on x64 machines can use up to 4Gb of virtual memory space and this space is unaffected by other processes running on the same machine.  This app does not appear to know the difference.  I would ask the vendor to provide a version which doesn't throw these messages, or at least, explain when it decides to throw that message so you can try to code around it.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


    Monday, December 15, 2014 4:43 PM
    Moderator
  • Thanks Matt. Could you explain how I can find that out with the dump myself the next time? A screenshot maybe how to locate the place where the DLL throws the message box? I might be able to forward that to the vendor so they fix their memory detection part (It was ported from WinCE iirc).

    May I also ask you to please redact the names of the vendor from your reply, just in case ;) Thanks

    Monday, December 15, 2014 5:15 PM
  • For this particular dump...


    1) Open with 32-bit WinDbg.
    2) .load wow64ext
    3) .effmach x86
    4) ~22s
    5) kPn
    6) Review the output and find the following:

    1776f988 55dfdd6e user32!MessageBoxW(
       struct HWND__ * hwndOwner = 0x00000000,
       wchar_t * lpszText = 0x19b8f530 "Zu wenig Speicher..Bitte beenden Sie die Anwendung!",
       wchar_t * lpszCaption = 0x1776f9bc "C:\Windows\syswow64\wwahost.exe",
       unsigned int wStyle = 0x30)+0x18


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


    Monday, December 15, 2014 5:22 PM
    Moderator
  • Thanks Matt, I will contact the vendor. Maybe their free memory detection routine does not work correct on a full fledged Win32 stack.
    Monday, December 15, 2014 6:30 PM