public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Tim Prince" <tprince@computer.org>
To: "Jack Lloyd" <lloyd@acm.jhu.edu>,
	"Bansal, Shashank" <Shashank.Bansal@Dresdner-Bank.com>
Cc: <gcc@gcc.gnu.org>
Subject: Re: Query
Date: Thu, 06 Dec 2001 07:44:00 -0000	[thread overview]
Message-ID: <015701c17e6b$9844f120$7add18ac@amr.corp.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0112060810550.27655-100000@sol.galaxy.acm.jhu.edu>


----- Original Message -----
From: "Jack Lloyd" <lloyd@acm.jhu.edu>
To: "Bansal, Shashank" <Shashank.Bansal@Dresdner-Bank.com>
Cc: <gcc@gcc.gnu.org>
Sent: Thursday, December 06, 2001 5:15 AM
Subject: Re: Query


> 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
>
Current stock linux distributions have a fixed 8MB stack limit.  Not long
ago it was 1MB.  A scheme to adjust this, including ulimit, as Jack
describes, and a re-configuration parameter, are sorely needed.  In
addition, compilers need a scheme such as the one planned for g95, where
objects above a certain size (threshold set by a compiler option), are
automatically put on the heap. Top quality Unix compilers have such a
scheme.  The current situation, where code has to be modified with explicit
use of malloc() in order to port to linux from Unix or Windows, is
unsatisfactory.

  reply	other threads:[~2001-12-06 15:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-06  1:37 Query Bansal, Shashank
2001-12-06  1:45 ` Query Bansal, Shashank
2001-12-06  5:19 ` Query Jack Lloyd
2001-12-06  7:44   ` Tim Prince [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-04-24 11:48 Query Vijay Kamath
2003-04-24 12:25 ` Query Andrew Haley
2002-03-01 21:14 query sunil suhas petwe
2002-03-10  4:44 ` query Andrea 'Fyre Wyzard' Bocci
2001-04-19  3:29 Query MNShukla
2001-04-19  5:51 ` Query Nick Clifton
2001-04-19 21:54   ` Query MNShukla
2001-04-20  3:29     ` Query Philip Blundell
2001-04-19  9:47 ` Query Toshi Morita
2001-01-22  6:20 Query MNShukla
2001-01-22  6:27 ` Query Richard Earnshaw
2001-01-22 12:28 ` Query Philip Blundell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='015701c17e6b$9844f120$7add18ac@amr.corp.intel.com' \
    --to=tprince@computer.org \
    --cc=Shashank.Bansal@Dresdner-Bank.com \
    --cc=gcc@gcc.gnu.org \
    --cc=lloyd@acm.jhu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).