stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: STD_BAD_ALLOC.cpp test problem on Windows
Date Wed, 06 Jun 2007 18:45:01 GMT
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [] 
>> Sent: Wednesday, June 06, 2007 5:57 PM
>> To:
>> Subject: STD_BAD_ALLOC.cpp test problem on Windows
>> Hi Farid,
>> In case you haven't seen this yet (I just noticed it for the 
>> first time myself), the STD_BAD_ALLOC.cpp has caused an ERROR 
>> in one of our MSVC builds on Windows. Do you see an easy way 
>> to prevent it from sucking up all the available memory on 
>> Windows like we do on UNIX via setrlimit()?
>> 64t-msvc-64b-8.0-15s-log.gz.txt
>   There new() called with (unsigned long)(-1) which is 0xffffffff on
> Windows 32 and Windows 64.
> If the workstation have 4 Gb of memory (including virtual) the memory
> allocation may be successful
> and take long time.
>   Possible that ( would
> help...

Ah, okay, a gotcha of LLP64. Thanks for fixing that problem!
Still, are you aware of any Windows API that lets programs
limit the amount of dynamic memory available to them, like
setrusage() does on UNIX? I ask because allocating so much
storage can put a big stress on the system, even if for
just a few seconds.


View raw message