cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/30/23:31:39

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Virtual Memory?
Date: Thu, 30 Apr 1998 23:23:59 -0400
Organization: Two pounds of chaos and a pinch of salt.
Lines: 34
Message-ID: <3549404F.392D@cs.com>
References: <6ibeah$2uq$1 AT winter DOT news DOT erols DOT com>
NNTP-Posting-Host: ppp126.cs.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Target wrote:
> 
> I wrote a little program that just makes link list until the user hits a key
> or fails to allocate memory. When I compiled it under DJGPP it only
> allocated about 20MB (32MB system), however when I compiled it under  Visual
> C it used did not run in to this barrier. Is the some compiler/linker option
> that I can use (I can't see DJGPP having this limitation).

Type "go32-v2" without parameters to see how much memory is available to
DJGPP programs.  If you're running your program under Windows 95, make
sure that you've increased the DPMI memory made available to DOS
programs.  This setting is under MS-DOS Prompt preferences, on the
Memory tab.  You can manually enter a value up to 65535 KB.  If you're
running under plain DOS, make sure you have enough free HD space to use
as virtual memory.

The default behavior of DJGPP's libc malloc() can sometimes result in
much greater memory usage than you intend simply because it rounds all
requests up to the nearest power of 2.  So if you allocate a huge number
of very small blocks you could run out of memory quite quickly.  Another
possible problem with lots of small allocations in an MS-DOS environment
is that you will overflow cwsdpmi's internal memory.  If this is a
problem, use cwsparam to increase cwsdpmi's internal heap (see
cwsparam.doc for instructions).

hth!

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Animals can be driven crazy by pla- |
|       aka Fighteer I       | cing too many in too small a pen.    |
|   mailto:fighteer AT cs DOT com   | Homo sapiens is the only animal that |
| http://www.cs.com/fighteer | voluntarily does this to himself."   |
---------------------------------------------------------------------

- Raw text -


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