This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libstdc++ test suite still drives machine into swap


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'?

> 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..

> The *only* way you can test std::bad_alloc reliably is to override
> libc malloc with something that fails on huge requests.  Resource
> limits are not sufficient.

I believe they are, 'ulimit -v' works for me.  Of course there may
also be other solutions.

Regards,
Wolfram.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]