X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Silvano Mantione" Newsgroups: comp.os.msdos.djgpp References: <3f944c94 DOT sandmann AT clio DOT rice DOT edu> Subject: HELP with DPMI under DOS - Part II Lines: 85 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <8N6lb.684$947.530@nntpserver.swip.net> NNTP-Posting-Host: 81.211.206.254 X-Complaints-To: news-abuse AT swip DOT net X-Trace: nntpserver.swip.net 1066727620 81.211.206.254 (Tue, 21 Oct 2003 11:13:40 MET DST) NNTP-Posting-Date: Tue, 21 Oct 2003 11:13:40 MET DST Organization: A Customer of Tele2 X-Sender: -@d81-211-206-254.cust.tele2.it Date: Tue, 21 Oct 2003 11:13:43 +0200 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Some notice: 1) for Ben Peddell: page-table overhead of about 1kB per 1MB of memory. Yes infact I go out of DOS memory when I try to allocate more than 500Mb (as Sandmann said). 2) for Meynard: I don't use EMM386, and Himem, after I tryed to free more DOS with himem and dos=high I success to allocate few more megabyte but never more 500Mb. 3) for DJ Deloirie: of course I allocate bytes. 4) for Eli Zaretskii : here is my short program: int main(int argc, char *argv[]) { char *pp; unsigned int mem, M; mem = _go32_dpmi_remaining_physical_memory(); printf("Avaiable %u\n", mem); printf("Stack %d\n", stackavail()); M=1024*1024*1024; do { pp= malloc(M); M-=1024; } while(!pp); M+=1024; printf("Allocati %db, %fk, %fM\n", M, (double) M/1024, (double) M/(1024*1024)); printf("Finito\n"); exit(0); } 5) for Charlies Sandman: I will try to use sbrk(), I use to disable swap file I will turn it on again (what about performance?). Some question where I will find cwsdpmi r6 and pmode/dj ? What about the unreal mode with djgpp executable ? If I use sbrk() I will have performance lost? Thank You Silvano "Charles Sandmann" wrote in message news:3f944c94 DOT sandmann AT clio DOT rice DOT edu... > > I'm tryuing to allocate an array of 1023Mb on a PC with 1Gb RAM installed > > but I can't success. > > How are you trying to allocate the memory? I would suggest you use > sbrk() to allocate such large chunks. I also suggest you remove EMM > providers from your configuration, and tell us what GO32-V2 prints. > > In my testing, I routinely allocate 2GB of memory for testing CWSDPMI, > so I know it works. It will fail if you disable paging and try to allocate > more than about 500MB. The long term fix for this is to use 4MB pages, > which is available in CWSDPMI r6 wip/test release. > > > I try do modify the parameters of cwsdpmi with > > cwsparam, I also try pmode/dj, but nothing to do. > > I've also allocated 2GB of memory with the most recent pmode/dj - so this > points to maybe something in your configuration or how you are trying to > allocate the memory. > > > I'm writing an application > > memory critical and I'm planning to buy 2Gb more memory (3Gb total) do > > someone have some idea to how can I allocate this memory in a single array > > under DOS? > > If you are planning to use more than 2GB, you *MUST* use sbrk() for > allocation. (There are limitations in malloc() which will prevent you > from using more than 2GB in a single allocation). > > Using 3GB (or 4GB) of memory under DOS in a single array has generated > lots of email to me - but so far no one has built a machine and tested > more than 2GB of physical usage - and sent me results. > > You will want to use the r6 test release if you plan to use more than > 500MB.