Document ID: 17590.1
Subject: WIN: "INSUFFICIENT MEMORY TO RUN APPLICATION"
Last Modified: 25 September 1996
Author: AADKOLI
_______________________________________________________________________________
The "Insufficient Memory To Run Application" Error under Windows
This document is intended to provide some information on a rather random error
that you may run into when you try to run Oracle software under Windows. The
error itself comes up in a dialog box with a message similar to:
"Insufficient Memory to Run application
Close one or more applications and try again"
BACKGROUND
When you start MS-Windows, it starts allocating memory for itself immediately
after the last DOS TSR loaded. The 640K and 1024K memory lines are ignored by
Windows.
Some DLL's (Dynamic Link Libraries) allocate what are known as 'fixed segments'
of memory via the GlobalDosAlloc() call in an attempt to lock pages of memory
in DOS conventional memory. So, when Windows loads a DLL that can allocate
fixed segments, the segment is moved down as low in memory as possible. A
consequence of this action is that the segment is moved down below 1Mb. The
memory below 1Mb is precious for real mode DOS programs and also the Windows
Task Database (this is where all running tasks are tracked by Windows ).
To get a new instance of an application running under Windows, an entry needs
to be added to the Windows Task Database (this is about 512 bytes). When this
area of 512 bytes is not available, you get the error "Insufficient Memory
to run application.."!
Some of the networking DLL's (JSB, WINSOCK/Proprietary API) allocate fixed
segments. Some of these fixed segments add up to a 100K. So, if you have
about 580-600K of conventional memory before you start Windows, Windows uses
approx. 300K of conventional memory (around 400K for Windows for Workgroups)
and now a few DLLs use the rest of the conventional memory by allocating
fixed segments, you will quickly get the "Insufficient memory..." error.
HOW DO YOU FIX IT?
Free up as much conventional memory as you can.
Do not load unnecessary TSRs like ANSI.SYS and MOUSE.COM if you are running
all your applications under Windows. Load as many TSRs in Upper Memory with a
LH or DEVICEHIGH (see the documentation for your memory manager for proper
syntax).
WHAT ELSE CAN YOU DO?
Use WIN_WRAP.EXE.
There is a program called WIN_WRAP.EXE that is available on the Compuserv
forum (under Microsoft forum in the US) that can be used as a wrapper to load
Windows applications.
HOW DOES WIN_WRAP WORK?
Everytime you load an application with WIN_WRAP (WIN_WRAP ), it
allocates all memory except the 512 bytes required to register the application
in the Windows Task Database. All fixed segments will be locked out and loaded
above 1Mb. When the application has been initialized and all code/data
segments required by the application have been loaded, WIN_WRAP frees the
memory below 1Mb that it allocated initially for the programs that need it
again.
UTILITY PROGRAM BELOW1MB
A utility called BELOW1MB is available on Compuserv. This utility shows all
the physical memory available under 1Mb. You can actually view this problem
with this utility.
WHAT ELSE CAN CAUSE THIS ERROR?
Incompatible DLLs with Oracle products can cause this error. You must
always use the proper versions of Required Support Files, GUI Common Files
etc. with your CDE tool.
Duplicate Oracle DLLs in your DOS PATH can cause problems that lead to the
"Insufficient Memory..." error. You must ensure that you only have a single
copy of every Oracle DLL in your path and this copy must be the most current
version of this DLL.
When MS-Windows loads a DLL it loads the first DLL in the search path that
matches the name. This can very easily result in a bad mix of old and new DLLs
which will almost certainly lead to problems. Here are some steps to ensure
that you do not have duplicate DLLs on your installation (assuming that
C:\ORAWIN is your home directory).
1. Go to C:\ORAWIN\BIN directory and rename one Oracle DLL that is
used by your CDE tool. A DLL named COREWIN.DLL is a good choice.
You can do something like (at DOS level):
MOVE COREWIN.DLL COREWIN.TMP
2. Re-start Windows and invoke the CDE product to force the DLLs
to load again. You can, maybe, starts Oracle Forms Designer
by double-clicking on the icon for that product. You should see
an error message in a dialog box similar to:
File Error
Cannot load COREWIN.DLL
CONCLUSION
In most cases, you will come across this problem in Windows for Workgroups and
Windows on Windows (under Windows NT). The problem revolves around the way
Windows moves memory around when there is a requirement for fixed segments.
Future releases of the operating system such as 'Chicago' are expected to
clear problems such as this.
ACKNOWLEDGEMENTS
This information has been compiled with substantial help from the following
individuals:
Jeremy Burton - Oracle UK
Vivek Raja - Oracle Worldwide Support
Mansoor Jafri - Oracle Worldwide Support