简体   繁体   中英

How can I increase the available memory for a process on Windows Mobile?

The amount of virtual memory available to my process is 32MB, although there's plenty more actual RAM. Is there a way (eg a function call or project property) that can increase this limit? I am finding the limit very....limiting.

I am looking at the usage by calling GlobalMemoryStatusEx . If there was something that could set the dwTotalVirtual member that's the kind of thing that would help.

thanks!

No, there's no way to increase that. Windows CE 5.0 and earlier had a hard, baked in limit of 32MB of virtual memory for any of the supported 32 simultaneous processes. It's part of the kernel.

Now it is worth mentioning that not all allocations come from that 32MB. From the docs (and experience):

If you call VirtualAlloc with dwSize >= 2 MB, flAllocationType set to MEM_RESERVE, and flProtect set to PAGE_NOACCESS, it automatically reserves memory in the shared memory region. This preserves per-process virtual memory.

This means that you can VirtualAlloc large regions and use that without impacting your 32MB slot limitation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM