www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/24/01:15:15

From: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Maximising conventional memory for shelled program
Date: Wed, 23 May 2001 23:40:34
Organization: Aspen Technology, Inc.
Lines: 31
Message-ID: <3b0c4a72.sandmann@clio.rice.edu>
References: <56a3c75f DOT 0105230150 DOT 75217dd4 AT posting DOT google DOT com>
NNTP-Posting-Host: dcloan.hou.aspentech.com
X-Trace: selma.aspentech.com 990680288 13101 10.32.115.107 (24 May 2001 04:58:08 GMT)
X-Complaints-To: postmaster AT aspentech DOT com
NNTP-Posting-Date: 24 May 2001 04:58:08 GMT
X-NewsEditor: ED-1.5.8
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> I'm trying to maximise the amount of conventional (below 640k) memory
> for a program that I 'shell' from a DJGPP program using the system
> library function. Operating system is MSDOS 6.22. It seems that the
> DJGPP program takes about 92k of conventional memory, estimated by
> taking the difference between a 'mem' command typed at the DOS prompt
> and one shelled from my program. I'm using the CWSDPMI extender. Any
> ideas welcome.

Ways to minimize conventional memory:
1) Stubedit your executable and change the transfer buffer to 4K bytes
   (or less, 2.5K used to be the minimum).
2) Stubedit your executable and change the DPMI provider name.  Copy 
   CWSDPMI.EXE to that new name.  Read CWSPARAM documentation and you
   can cut some memory from what it uses.  (You could also do the same
   with CWSDSTUB for a single exe image with hacked parameters).

If I remember correctly you should be able to lower the total memory usage
for a DJGPP application to around 64K or so; if you have UMBs available
most of that 64K can go in the UMBs.  Really aggressive tuning may get
the size smaller.  I remember at one time proving a DJGPP image could run
in something like 70Kb total memory in an early release ...

In particular, if your system has lots of memory or disk CWSDPMI allocates
bitmaps and page tables anticipating you will want to use much of it, but
if you only need 4Mb of DJGPP address space you can trim all that memory
usage.  It's also built to handle lots of memory allocation requests and
lots of DPMI nesting - you can also trim memory from the "extra paragraphs"
to make more space.  You can manually specify the number of page tables 
and disable swapping for more memory.

Have fun.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019