Re: Compiler options and memory overheads
- From: "Severian [MVP]" <severian@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 26 Jun 2005 05:22:28 GMT
On Sat, 25 Jun 2005 14:44:29 -0700, "Alexander Grigoriev"
<alegr@xxxxxxxxxxxxx> wrote:
>If you allocate tens of megabytes, you better use an allocator based on
>VirtualAlloc, not HeapAlloc. The default heap won't grow over some limit.
True, but I would say hundreds of megabytes.
>Using memory-mapped files as memory is a waste of time, unless you want to
>guarantee you will never run out of swap space.
Exactly. This reduces support calls, and has the additional benefit of
not causing the stupid default Windows page file to extend on large
allocations. The time required to memory-map a file is minimal, and
paging from the memory-mapped file is not measurably slower than from
the page file.
Another reason is that users with a "little knowledge" about memory
complain when a program uses a lot of page file space, even when they
are working on 500 MB images. By using memory-mapped files for the
virtual memory, this again reduces support calls and complaints.
As a small company with a large customer base, it's often better for
us to prevent the support reports rather than have to educate the
customers about Windows internals.
"Let Windows manage my page file" (or whatever its name is now) is a
very poor default setting, which affects system performance when the
page file must be extended and especially when it gets fragmented.
>"Severian [MVP]" <severian@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>news:s03qb1p2b2ep34mc3j6rribcsu864obknd@xxxxxxxxxx
>>
>> ...Unless you're frequently allocating large amounts of memory (>100
>> MB for example); then it's quite useful to use separate heaps -- and
>> compact them -- or even memory-mapped files (to avoid excessive page
>> file use).
>>
>> Low-fragmentation heaps can be helpful in some situations, on the
>> later O/Ses that support them.
>>
>> --
>> Phillip Crews aka Severian
>> Microsoft MVP, Windows SDK
>> Posting email address is real, but please post replies on the newsgroup.
>
--
Phillip Crews aka Severian
Microsoft MVP, Windows SDK
Posting email address is real, but please post replies on the newsgroup.
.
- References:
- Compiler options and memory overheads
- From: Lindsay
- Re: Compiler options and memory overheads
- From: Scott McPhillips [MVP]
- Re: Compiler options and memory overheads
- From: Severian [MVP]
- Re: Compiler options and memory overheads
- From: Alexander Grigoriev
- Compiler options and memory overheads
- Prev by Date: Re: #include <winsock.h>?
- Next by Date: Re: #include <winsock.h>?
- Previous by thread: Re: Compiler options and memory overheads
- Next by thread: Re: Problems compiling simple C++ code (also problems with std::string)
- Index(es):
Relevant Pages
|