FIX: OnIdle() Processing Can Hang in Low-Memory Situations

ID: Q116135

1.00 WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

SYMPTOMS

An application that uses the Microsoft Foundation Class (MFC) library might hang in situations where memory is extremely low.

CAUSE

The MFC library does idle-time processing to attempt to reclaim available memory for its safety memory pool. This processing is done in CWinApp::OnIdle() at approximately line 540 in the module APPCORE.CPP. OnIdle() uses a while loop to attempt to reclaim this memory. However, if the available memory is sufficiently low, the entire pool cannot be reclaimed and the while loop never exits, hanging the application.

RESOLUTION

To avoid the potential problem, do one of the following:

STATUS

Microsoft has confirmed this to be a problem in Visual C++ for Windows, version 1.0. This problem was corrected in Visual C++ 1.5.

This is not a problem in Visual C++ 32-bit Edition.

MORE INFORMATION

For more information regarding building the MFC library, refer to Appendix B in the "MFC User's Guide," provided with Visual C++ for Windows, version 1.0.

Additional reference words: runtime infinite loop 1.00 2.00 KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: MfcMisc

Keywords          : kb16bitonly kbnokeyword kbMFC kbVC kbbuglist kbfixlist
Version           : 1.00
Platform          : WINDOWS
Solution Type     : kbfix

Last Reviewed: September 21, 1997