Microsoft KB Archive/102113

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 09:29, 20 July 2020 by X010 (talk | contribs) (Text replacement - """ to """)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


FIX: "Out of Virtual Memory" Message may be Caused by chdir()

Article ID: 102113

Article Last Modified on 10/24/2003



APPLIES TO

  • Microsoft Visual C++ 1.0 Professional Edition
  • Microsoft Visual C++ 2.0 Professional Edition



This article was previously published under Q102113

SYMPTOMS

When you run an application that calls the chdir() function many times, an "Out of Virtual Memory" error may occur. You may also notice that the page file grows continuously as the application executes.

CAUSE

The chdir() function allocates a small amount of memory each time it is called. When the function successfully completes execution, it does not free the memory and causes a small memory leak. Because no application accesses the memory, it is eventually swapped into the page file. The "Out of Virtual Memory" error occurs when the page file cannot grow any larger.

RESOLUTION

An application developed for the Win32 or Win32s operating systems can avoid the memory leak by using the SetCurrentDirectory() function. SetCurrentDirectory() changes the current directory for the current process.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ version 2.1.


Additional query words: 1.00 2.00 8.00 9.00

Keywords: kbbug kbfix kbcrt KB102113