tags:

views:

32

answers:

1

I have application that runs on x86 32Win and we use 1.2Gbyte memory which allocated from the function VirtualAlloc(to prevent page faults).

I really want to increase my application memory so I recompiled my project under MSDVE 2008 with wow64 (OS Exp 64Bit).

I tried to allocate more than 2Gbyte and the function VirtualAlloc return error.

I even tried to set the flag LARGEADDRESSWARE to on, and the result was the same!

How can I increase my application memory, till using the VirtualAlloc function, with the WOW64?

A: 

Are you making a single call to VirtualAlloc? If so the OS will need to return a single continuous address range.

Although a LARGEADDRESSAWARE 32-bit exe can access the full 4GB of address space under WOW64 it doesn't mean you can find a continuous piece of address space >2GB.

Try making multiple calls for smaller blocks.

Rob Walker
yes I'm making it with a signgle call.there is any way to make it we one large allocation?
Not really with a 32 bit app. If you need that much contiguous address space you should compile 64 bit. By the time your code is able to call VirtualAlloc the OS will have already mapped your executable and numerous DLLs to various places in the address space, fragmenting what is available. For example, a single page allocated at 0x80000000 would restrict you to at most a 2GB block.
Rob Walker