public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Zack Weinberg" <zackw@Stanford.EDU>
To: Wolfram Gloger <Wolfram.Gloger@dent.med.uni-muenchen.de>
Cc: gcc@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: libstdc++ test suite still drives machine into swap
Date: Wed, 27 Jun 2001 10:28:00 -0000	[thread overview]
Message-ID: <20010627102446.A2274@stanford.edu> (raw)
In-Reply-To: <200106271010.MAA61257@max.zk-i.med.uni-muenchen.de>

On Wed, Jun 27, 2001 at 12:10:26PM +0200, Wolfram Gloger wrote:
> Hello,
> 
> > The libstdc++ test suite still drives my machine, which has plenty of
> > RAM thank you, into swap.  I suspect this is because ulimit -d does
> > not actually work on Linux, because libc allocates huge blocks with
> > anonymous mmap, and anonymous mmap ignores that particular limit.
> 
> Yes, so if you want to limit RAM usage, why not just use 'ulimit -v'?

Well, for one thing, with my /bin/sh:

$ ulimit -v 2048
ulimit: Illegal option -v

I suppose we could wire a setrlimit(RLIMIT_AS, ...) call into the test
case itself - frankly, that is also the only way I'd be confident that
the limit actually affected the relevant process.

But that's not the right call to make on other systems.  If we went
this way, it would make sense to export a helper function from
libstdc++ that did the Right Thing for you.

> > What actually happens is that execution never gets past the
> > std::string constructor.  Malloc lies.  It gives you a pointer to
> > memory that does not exist, on the theory that you won't *really* use
> > all of it.
> 
> Actuallly, I think it's more accurate to state that the kernel lies.
> But we all like over-commitment, don't we..

True enough.  I've seen people argue that overcommitment is a
violation of the C standard (not that I necessarily agree).  The
program certainly can't tell whether it's the kernel or the C library
doing the lying...

-- 
zw     I *will* wrestle it into shape eventually. I *will* clean it out,
       *without* resorting to the redirection of a major navigable river.
       	-- Ray Radlein on lumber rooms

  reply	other threads:[~2001-06-27 10:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-26 19:57 Zack Weinberg
2001-06-27  3:10 ` Wolfram Gloger
2001-06-27 10:28   ` Zack Weinberg [this message]
2001-07-31 18:53 ` Phil Edwards
2001-07-31 20:46   ` Gabriel Dos Reis
2001-07-31 22:59     ` Benjamin Kosnik
2001-08-01  0:22       ` Gabriel Dos Reis
2001-08-01 12:22       ` Phil Edwards
2001-08-01 13:29         ` Stephen M. Webb
2001-08-01 14:02           ` Phil Edwards
2001-08-02  6:01             ` Stephen M. Webb
2001-08-02 13:31               ` Phil Edwards
2001-08-02 15:41 Zachary Weinberg
2001-08-02 16:19 ` Phil Edwards
2001-08-02 16:40   ` Zack Weinberg
2001-08-03 10:27     ` Phil Edwards
2001-08-02 19:28   ` Hans-Peter Nilsson
2001-08-03  6:10     ` Stephen M. Webb

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=20010627102446.A2274@stanford.edu \
    --to=zackw@stanford.edu \
    --cc=Wolfram.Gloger@dent.med.uni-muenchen.de \
    --cc=gcc@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /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).