From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7413 invoked by alias); 6 Dec 2001 13:15:51 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 7361 invoked from network); 6 Dec 2001 13:15:45 -0000 Received: from unknown (HELO centaur.acm.jhu.edu) (128.220.223.65) by sources.redhat.com with SMTP; 6 Dec 2001 13:15:45 -0000 Received: from sol.galaxy.acm.jhu.edu (typhon.acm.jhu.edu [128.220.223.231]) by centaur.acm.jhu.edu (Postfix) with ESMTP id 7983714355; Thu, 6 Dec 2001 08:15:43 -0500 (EST) Received: by sol.galaxy.acm.jhu.edu (Postfix, from userid 528) id 7A18BD8C9; Thu, 6 Dec 2001 08:15:42 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by sol.galaxy.acm.jhu.edu (Postfix) with ESMTP id 5E25078B0; Thu, 6 Dec 2001 08:15:42 -0500 (EST) Date: Thu, 06 Dec 2001 05:19:00 -0000 From: Jack Lloyd X-Sender: To: "Bansal, Shashank" Cc: "'gcc@gcc.gnu.org'" Subject: Re: Query In-Reply-To: <81D792FDA471D21190DB0008C7A41A0601C02FDB@kbi01ea0.wwz1me.mail.dresdner.net> Message-ID: X-GPG-Key-ID: 4DCDF398 X-GPG-Key-Fingerprint: 2DD2 95F9 C7E3 A15E AF29 80E1 D6A9 A5B9 4DCD F398 X-Red-Robot-Approved: CRUSH ALL HU-MANS! Organization: JHU ACM/CS/CIRL MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2001-12/txt/msg00275.txt.bz2 On Thu, 6 Dec 2001, Bansal, Shashank wrote: > Hi, > > I wished to create some large dimensional arrays in a program (6000x1000) > and it fails to upload this memory (stack overflow). As soon as i reduce the > dimension of arrays..it works perfectly. Most likely you have a limit in place that limits the size of your stack. Assuming you're running on a Unix system, try running the command `ulimit -s`; that will tell you how much stack space you can allocate. You may be able to raise this limit. 6000x1000x4 (array of ints), is about 22 megabytes. I suppose it is possible that some machines and/or operating systems will not let you use this much stack space ever. > Could u help me out. I have tried this on different machines. > Could you also tell if I could create virtual memory or somethign of that > sort for the program. The best solution is probably to use the C malloc function or the C++ new operator to create the memory, or use C++'s vector<> type. -Jack