Mail Archives: djgpp/2000/10/07/14:30:35
> 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.
- Raw text -