Page 1 of 1

I want to allocate 16Mb but can't

PostPosted: Sep 8, 2005 @ 6:50pm
by matt99
I'm developing an application based on ipaq hx4700. I'd like to get 16Mb memory(256*256*256 chars), but I can't! It worked on h5550 perfectly. h5550 has 128Mb memory(and 4700 = 64Mb) but I think it doesn't matter because one process can get just 32Mb memory(<-Am I right? :roll: ).
With GlobalMemoryStatus(), there's enough memory spaces to get 16Mb. I tried with malloc and VirtualAlloc but failed. I tested and I can get *just* 8Mb memory.
It's not a problem about *allocate and free again and again*. I just allocate 16Mb when my application is started, and free it when I quit. What can I do? I'm going crazy... lol

Re: I want to allocate 16Mb but can't

PostPosted: Sep 9, 2005 @ 6:15am
by mamaich
I allocate huge chunks of memory via memory mapped files. CreateFileMapping(NULL,...)

PostPosted: Sep 10, 2005 @ 9:13pm
by drgoldie

wow!

PostPosted: Sep 11, 2005 @ 12:18pm
by matt99
Thanks guys, you saved me :lol:

Re: wow!

PostPosted: Sep 14, 2005 @ 12:16am
by mamaich

PostPosted: Sep 14, 2005 @ 7:44am
by drgoldie
for my current research project i need more RAM than a process memory slot (especially counting DLLs in) can provide.

Doug Lea's heap implementation already uses VirtualAlloc under Windows, so i only had to make sure, that 2MB blocks are reserved in order to have a custom heap that can use all of the PDA's memory.

i wish that MS would one day remove this ugly 32MB barrier from WinCE. at least under WinCE 5.0 this issue is still the there.

bye,
Daniel