Farid Zaripov wrote:
-----Original Message-----
From: Martin Sebor [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 06, 2007 5:57 PM
To: stdcxx-dev@incubator.apache.org
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()?
http://people.apache.org/~sebor/stdcxx/results/windows-2003-em
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 (http://svn.apache.org/viewvc?view=rev&rev=544910) 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.
Martin