Number of forms open before out of memory (OpenInsight Specific)
At 25 JUN 1998 06:31:15AM Jeff Word wrote:
Our app uses the MDI/child design model everywhere. We are typically able to open about 3 MDI's with about 4 children on each MDI. Then we are out of memory on a computer with 32 MB of ram. We thought we would be able to open more.
Can several developers give me feedback on approximately how many forms you can have open before you have used up the memory.
Is every window basically equal (except for the number of controls) or do MDI windows take up more memory? Does anyone have any ways (or ideas) how to program in a way as to make OI more efficient in its use of memory? Anything to avoid which you know hogs memory? All suggestions welcome!
At 25 JUN 1998 02:08PM Scott Kearney wrote:
Jeff,
If you don't have one, I'd suggest getting a little memory monitor utility (like Norton's) and make sure it also monitors resources. From what I remember, if you ran out of resources, you would get "out of memory" errors, instead of a much more sensical "out of resources" error. Windows95 improved a lot upon Windows 3.x as far as system resources are concerned, but they didn't completely alleviate the problem. Depending on how many windows objects you have floating on your screen, you can run out of resources prematurely.
-Scott Revelation
At 27 JUN 1998 08:38PM Aaron Kaplan wrote:
You have about 64K worth of things that can be active at any given point before GDI resources bomb out….or is it user? Cam? That's why it's still WIN.COM, even in 32 bit Win95.
At 27 JUN 1998 10:00PM Cameron Revelation wrote:
Jeff,
In Windows 3.x, USER, GDI, and KERNEL (aka KRNL386.EXE) each had a 64k heap, which means in reality about 60k of memory to allocate. The structures that Windows™ maintains internally for windows on the screen are allocated from the USER heap, and there was only enough space to allocate about 400 total. Now by the time you see anything on your screen, there are lots of windows already created … most invisible … and each control is typically at least one window. So you would end up with a realistic limit of about 250-300 total windows/controls that could be running at one time.
In Windows 95 they did some really creative work to expand that 64k (to 2mb apparently) but also increased the size of the window structure so the net gain is not what you would think. However, I suggest using Windows 95 (or OSR2 or 98) if at all possible for resource reasons.
You can determine resource usage on the fly. There is a knowledge base article about it but the posting of it was messed up. There is also sample code shipped with the Works that shows how, but I am not sure the name of the code.
Cameron Purdy
Revelation Software