Date: Sat, 07 Oct 2000 20:30:46 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: michael AT idisys DOT iae DOT nsk DOT su Message-Id: <7263-Sat07Oct2000203046+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.5h CC: djgpp AT delorie DOT com In-reply-to: <20001007141427.10046.qmail@idisys.iae.nsk.su> (michael AT idisys DOT iae DOT nsk DOT su) Subject: Re: Memory amount and PMODE References: <20001007141427 DOT 10046 DOT qmail AT idisys DOT iae DOT nsk DOT su> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: michael AT idisys DOT iae DOT nsk DOT su > Date: 7 Oct 2000 14:14:27 -0000 > X-Newsgroups: comp.os.msdos.djgpp > > So maybe PMODE doesnt use more than 64Mb, there's no hint in > documentation what can I do. It looks like PMODE indeed doesn't support more than 64MB. In general, I would advise not to use PMODE unless you have a very good reason. (For starters, it doesn't support virtual memory.) > Namely, I expected to have all memory Unfortunately, these expectations are unjustified: many DPMI environments will limit you to 64MB. For example, Windows 9X only supports more than 64MB if you have more than 64MB physically installed. For details, read chapter 15 of the DJGPP FAQ list. > BTW - i know that STL has own allocators, is there way to optimize it for > size (not for speed). I don't know. But it strikes me that, since you have 128MB installed, there's no need to dig so deep into the library internals. It is much easier (and more portable!) to change your data structures and/or algorithms so that it will use the available memory much more efficiently. > And how can i estimate in the program (run-time) > free/busy memory amount (as far as I concerned sbrk(0) traces heap, how can > I find out if the program runs out of stack - to catch memory eating > block). You have the `stackavail' function in the library to see how much stack is available. However, please note that it's a rare program that consumes significant amounts of the stack space. The default stack space in DJGPP programs is 512KB, and it is allocated in its entirety by the startup code.