简体   繁体   English

如何在Windows Mobile上增加进程的可用内存?

[英]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. 我的进程可用的虚拟内存量是32MB,尽管有更多的实际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 . 我通过调用GlobalMemoryStatusEx来查看用法。 If there was something that could set the dwTotalVirtual member that's the kind of thing that would help. 如果有什么东西可以设置dwTotalVirtual成员那将是dwTotalVirtual的东西。

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. 对于任何支持的32个并发进程,Windows CE 5.0及更早版本都具有32MB的虚拟内存限制。 It's part of the kernel. 它是内核的一部分。

Now it is worth mentioning that not all allocations come from that 32MB. 现在值得一提的是,并非所有分配都来自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. 如果使用dwSize> = 2 MB调用VirtualAlloc ,将flAllocationType设置为MEM_RESERVE,并将flProtect设置为PAGE_NOACCESS,则会自动保留共享内存区域中的内存。 This preserves per-process virtual memory. 这样可以保留每个进程的虚拟内存。

This means that you can VirtualAlloc large regions and use that without impacting your 32MB slot limitation. 这意味着您可以使用VirtualAlloc大区域并在不影响32MB插槽限制的情况下使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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