From: Andreas Dorn Newsgroups: comp.os.msdos.djgpp Subject: Re: Large Arrays Date: Fri, 06 Jul 2001 00:42:27 +0200 Organization: University of Heidelberg, Germany Lines: 42 Message-ID: <3B44ED53.5D18BCAF@web.de> References: <3B447193 DOT E7BA25AB AT ix DOT urz DOT uni-heidelberg DOT de> <7263-Thu05Jul2001212841+0300-eliz AT is DOT elta DOT co DOT il> NNTP-Posting-Host: ppp304.urz.uni-heidelberg.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.urz.uni-heidelberg.de 994372883 3644 129.206.203.104 (5 Jul 2001 22:41:23 GMT) X-Complaints-To: usenet AT news DOT urz DOT uni-heidelberg DOT de NNTP-Posting-Date: 5 Jul 2001 22:41:23 GMT X-Mailer: Mozilla 4.7 [de]C-CCK-MCD CSO 1.0 (Win95; I) X-Accept-Language: de,en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote: > > From: Andreas Dorn > > I need a really large array for a matrix (~100 MB). > > With linux/unix and gcc that worked fine, but with dos/windows this > > never worked. Even with 256MB RAM and "small" arrays (<5MB) it didn't > > work. > > > > The initialisation of the array looks like this: > > > > int main(void) > > { > > const int Dimension=5000; > > > > float TheMatrix[Dimension][Dimension]; > > int i,j; > > Your program is blowing up the run-time stack, which by default is > only 512KB large. See section 15.9 of the DJGPP FAQ list for more > details. > > > - I don't have much experience with dos/windows compilers. What is the > > reason for the memory-problems? And how much memory do I get for an > > array under win3.11, win95, ..? > > The amount of available memory can be seen by running the go32-v2 > program with no arguments. A typical Windows system lets you use at > least 64MB of memory; if you have more than 64MB physical memory > installed, Windows will let you use up to the amount of the installed > memory. > Chapter 15 of the FAQ has more about this. > > > - Is there an easy solution (a compiler option or something) to get a > > working array? (option: -WA :-)) > > You can stubedit the executable for a larger stack, or you can > allocate the array at run time with malloc. Again, the FAQ has the > details. Thank you for the information. I only have to check now what happens if I use a lot of swap-space... but I think there'll be no trouble. Andreas Dorn