🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2573

Re: Allocating a lot of memory (why can't I?)

#2573
From: Don CORBITT
Date: Fri, 10 May 1991 19:20
21 lines
1634 bytes
>rob@pcad.UUCP (Ralph Brown) writes:
>> Running Win 3.0 in enhanced mode, there seems to be some limit to how
>> much memory a windows app can allocate which is much less than the
>> amount of free virtual memory. With over 7Mb free, I could only do
>> a Global32Alloc of about 1.3 Mb. A second copy of the same program could
>> simultaneously get about the same amount leaving about 5Mb still free.

I'm not sure what's happening on your systems.  It is possible your heap
is filled with pagelocked objects, but real unlikely.  Are you calling
GlobalAlloc(), or are you calling GlobalCompact(0)?  Note that under
Enchanted mode, GlobalCompact() doesn't really compact the heap, it just
tells you the largest block you can get _without_ compacting.  This is
on purpose, since compacting the heap on a page-swapping system takes a
lot of time and disk access.  If you really want a lot of memory, just
allocate it.  This will convince Windows that you are serious, and force
heap compaction.

I'm able to routinely allocate 4 MB (and sometimes 8MB) on my system with
8MB ram, (6MB available to Windows).  You should be able to, also.
--
Don Corbitt, MSWinDev
Technical Details
Message-ID: <72271@microsoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!microsoft!donc
References: <518@pcad.UUCP> <H4Lg21w163w@coyote.datalog.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!microsoft!donc
From: donc@microsoft.UUCP (Don CORBITT)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Allocating a lot of memory (why can't I?)
Message-ID: <72271@microsoft.UUCP>
Date: 10 May 91 19:20:03 GMT
References: <518@pcad.UUCP> <H4Lg21w163w@coyote.datalog.com>
Reply-To: donc@microsoft.UUCP (Don CORBITT)
Organization: Microsoft Corp., Redmond WA
Lines: 21