delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/18/07:20:43

Date: Mon, 18 Oct 1999 10:38:41 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "sephiroth AT id-base DOT com" <sephiroth AT id-base DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Memory allocation limit?
In-Reply-To: <380A114A.48B06112@id-base.com>
Message-ID: <Pine.SUN.3.91.991018103822.3777Q-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 17 Oct 1999, sephiroth AT id-base DOT com wrote:

> Is there a limit to how much memory I can allocate with the c++ new
> function in DJGPP?

Of course, there is a limit.  Invoke the go32-v2 program with no
arguments: the sum of the two numbers it prints is the total amount of
memory you can allocate in your DJGPP programs.

> I seem to get the error:
> Virtual memory exceeded in `new'
> I looked at my program, and it appears that not much memory is
> allocated( I can't put an exact figure on it, but no more than 5mb I
> think ).

How do you know it only allocates 5MB?

Don't forget that some memory is allocated for the code, data, and
stack of your program.  The stack, for example, is 512KB.

> If anyone can answer these questions, I would really appreciate
> it.

Take a look at Chapter 15 of the DJGPP FAQ list.  It might give you
some ideas.  If that doesn't help, come back here, tell what you have
found out and ask more specific questions.

- Raw text -


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