This article was previously published under Q176765
This article has been archived. It is offered "as is" and will no longer be updated.
A program that loads a series of icon files into the Picture property of a Visual FoxPro image object causes a memory leak in Visual FoxPro 3.0b, 5.0x, and 6.0. Eventually, the operating system becomes unstable and the computer locks.
Loading the icon files may create a leak in process memory. As the programruns, increasing amounts of RAM are consumed. When the program starts usingvirtual memory, performance suffers and the computer may lock.
Currently, there is no resolution, but following are two workarounds:
Use a bitmap instead of an icon file to display an image in the Picture property.-or-
Use an OLE container control that contains the Visual FoxPro HWND .ocx control to display the icon.
Microsoft has confirmed this to be a bug in the Microsoft products listedat the beginning of this article.
Steps to Reproduce Behavior
WARNING: Running the code below causes a low memory situation on thecomputer. This condition may cause the operating system to become unstable.Close all open applications and save your data before using this procedure.In Microsoft Windows 95 and Microsoft Windows NT, press the CTRL+ALT+DEL keys simultaneously toinvoke the Close Dialog window or the Task Manager, respectively.
Create and run a program that contains the following code:
The first indication of a memory problem appears when the icons no longerappear in the individual image objects. The number of iterations beforethis symptom appears depends on the amount of physical RAM installed on thecomputer. Once the memory leak consumes all the physical RAM, Visual FoxProbegins using virtual memory. At this point, performance suffers greatly andthe operating system may lock.
Visual FoxPro Help 3.0b, 5.0, 5.0a; search on: Visual FoxPro HWND Control