
APAR= II08661
WINDOWS ERROR MESSAGE:  INSUFFICIENT MEMORY TO RUN APPLICATION.

Updated 03-29-96
5738PC1 5763XB1 5763XC1 MAY GET AN ERROR MESSAGE WHEN
RUNNING IN THE WINDOWS ENVIRONMENT THAT STATES THAT THERE
IS NOT ENOUGH MEMORY TO RUN AN APPLICATION.
.
This error message usually means that there is not enough
conventional memory available for Windows to launch another
application.  There may be plenty of available extended memory
that Windows has access to; however, Windows is still basically
just a DOS extender and needs to use some conventional memory
to start each program.  Each application that is started in
Windows requires at least 512 bytes of conventional memory for
the application's Program Segment Prefix (PSP).  The PSP is used
by DOS and must be loaded in conventional memory.  If Windows
cannot load a PSP in conventional memory, it will issue an
"Insufficient memory to run application..." error.
.
The conventional memory is being used by the terminate and stay
resident programs that were loaded before starting Windows,
this includes drivers for CD-ROMs, sound cards, etc.  Some of
the conventional memory is being used by the Windows kernal
code.  The Windows drivers for the keyboard, the mouse, sound,
etc. all use conventional memory also.
.
Windows manages the memory for Windows programs.  When Windows
has loaded, it allocates all of the available conventional
memory for use in its Global Heap.  Any Windows programs or
DLLs that have been programmed to have their memory FIXED, will
be loaded into Windows' Global Heap.  Since Windows uses a
bottom-up-first-fit scheme for allocating memory, it will often
load code into conventional memory (since this memory is at the
bottom of the Global Heap).  This can cause a shortage of
conventional memory by allocating all of the conventional
memory for FIXED segements that could be loaded in extended
memory.  While we cannot change Windows memory management, we
can make more conventional memory available before starting
Windows.  This can be done by loading as few programs as
possible in DOS and getting the newest drivers that are
available.  For example, often times a mouse driver is loaded
in DOS but isn't needed since Windows is the exclusive
operating environment and a separate mouse driver is loaded
in Windows.
.
The Windows setup can be modified to not load unused, default,
drivers as well.  For example, the mmsound.drv is for providing
sound in Windows.  If sound is not desired, it can be removed
from the SYSTEM.INI file.  You may find drivers that were added
to the SYSTEM.INI file by an application that is no longer used
are using conventional memory and can be removed.
.
Before making any changes to your SYSTEM.INI, or any other
configuration files on your PC, be sure to make a safe backup
copy of these files so that there is always an available
reference point to go back to.
.
These changes alone may not be enough if a large DLL or program
is being loaded into conventional memory by Windows when it
does not have to be in conventional memory.  Some programs,
especially communications programs, may have to load in
conventional memory, in order to communicate with the DOS
operating system.  As stated earlier, we cannot directly change
the way that Windows manages memory; however, we can do
something about this problem by either fragmenting the
conventional memory or allocating almost all of it before
Windows can load anything there.
.
The first approach, fragmenting the lower memory, works because
the size of the free blocks of memory are reduced so that large
DLLs or programs cannot load into the conventional memory.
This forces Windows to load the FIXED segments higher in memory
above one megabyte.  A program is available that does this:
1MBFORT.  This program is available by ftp at
ftp.zdnet.com
and can be found in the
pcmag/1995/0328
directory.  The files in this directory should include the
documentation file and compressed program:  1mbfort.zip.
.
The second approach makes almost all of the conventional memory
unavailable when a program tries to allocate memory from the
Global Heap.  Enough memory is left for a PSP but large FIXED
segments will be forced to be loaded above one megabyte.  A
program which can do this is also available:  FIX1MB.EXE.  This
program may be downloaded from ftp.microsoft.com and may be
found in the developr/MSJ/ directory.  The file to download is
MSJMAY95.EXE which is a self-extracting archive containing
several more self-extracting archives.  The program,
WQA0595.EXE, is the self extracting archive in MSJMAY95.EXE
that contains FIX1MB.EXE, PROCHOOK.DLL, and FX1MBDLL.DLL--the
files that are needed to run FIX1MB.
FIX1MB is more dynamic in nature than 1MBFORT.  FIX1MB can be
added to the SYSTEM.INI file so that it is part of the Windows
startup and can effectively keep many drivers out of lower
memory.  You might not be able to do this in some situations,
for example if you are using a network driver, the network
driver may fail to load if FIX1MB is loaded before it is.
Client Access/400 functions themselves may not work correctly
with this program running.  One effective technique is to load
FIX1MB in the SYSTEM.INI and once Windows has started, close
FIX1MB and use the PC normally.  In many setups this is all
that needs to be done to use Client Access functions without
memory related failures.
.
By starting one of these programs at the start of Windows, you
can preserve precious conventional memory.  Both of these
programs provide a way to view how much conventional memory is
actually free once you are in Windows.  This is not possible
without the use of such a tool.
.
One more technique which can reduce your conventional memory
usage is to not load the Client Access/400 Network Driver.
By not loading this network driver you will lose some of the
features of Client Access, but will not lose the functions.
For example, you can assign a network drive through the Folders
icon but will lose the ability to assign a drive through File
Manager.  This may prove to be a good trade-off of some of the
Client Access features for better overall functionality of
Windows.
.
