Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is the maximum memory that VirtualAlloc() can allocate?

385 views
Skip to first unread message

Brilliance Qian

unread,
Nov 8, 2001, 4:34:49 PM11/8/01
to
I have 128MB physical memory in my cepc and I have modified oeminit.asm and
MainMemoryEndAddress in OEMInit(). In the Control Panel/System it displays
that I have 100+MB memory available.

I wanted to allocate a data buffer over 32MB using VirtualAlloc() in an
application but it failed and returned NULL. I tried it again in a driver,
it also failed. I decreased buffer size to 30MB, it failed, too. What is
problem? How much maximum memory can VirtualAlloc() allocate?

Any idea on allocating a data buffer over 32MB? I tried mapped file but a
single mapped file also can not be over 32MB because of win ce limitation.

Any help is highly appreciated.

Randall Hyde

unread,
Nov 8, 2001, 6:29:54 PM11/8/01
to
Under WinCE, each process is given a 32MB block of virtual
addresses. Maybe this is your problem (attempting to exceed
this value).
Randy Hyde

"Brilliance Qian" <brillia...@dactron.com> wrote in message
news:um#jUwJaBHA.2408@tkmsftngp05...

Brilliance Qian

unread,
Nov 8, 2001, 7:44:30 PM11/8/01
to
From PB help,
"You can allocate additional memory, outside of the 32 MB that is assigned
to each slot, by using memory-mapped files or by calling the VirtualAlloc
function."

So, the memory which VirtualAlloc() allocates is not in process space 32 MB.
Does it still have size limitation on it?

"Randall Hyde" <rh...@transdimension.com> wrote in message
news:u7yTW2KaBHA.2056@tkmsftngp02...

Steve Maillet - Windows Embedded MVP

unread,
Nov 8, 2001, 8:36:21 PM11/8/01
to
Actually that quote is incorrect (or at best misleading depending on your view). VirtualAlloc allocates a piece of the
processes 32M space for use. You can get to more memory beyond the 32M by using Shared Memory mapped files which are
allocated from a space above the 32 slots. But be forewarned that that memory is totally unprotected from access from
other apps.

--
Steve Maillet - [Microsoft Windows Embedded MVP]
Entelechy Software Consulting
smaillet 'AT' EntelechyConsulting 'DOT' com
http://www.EntelechyConsulting.com
"Brilliance Qian" <brillia...@dactron.com> wrote in message news:uMGWSaLaBHA.1432@tkmsftngp04...

0 new messages