运行后,我看到我的应用程序在 TaskMgr 中占用了 3.5Gb
我在 Windbg 中看到的有点令人困惑:
0:022> !address -summary
ProcessParametrs 0000000001b7ed70 in range 0000000001b7e000 0000000001b80000
Environment 0000000001c0c970 in range 0000000001c0c000 0000000001c0e000
-------------------- Usage SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Pct(Busy) Usage
1037fe000 ( 4251640) : 00.05% 87.22% : RegionUsageIsVAD
7fed67a5000 (8585059988) : 99.94% 00.00% : RegionUsageFree
7dd6000 ( 128856) : 00.00% 02.64% : RegionUsageImage
1900000 ( 25600) : 00.00% 00.53% : RegionUsageStack
32000 ( 200) : 00.00% 00.00% : RegionUsageTeb
950000 ( 9536) : 00.00% 00.20% : RegionUsageHeap
1bff4000 ( 458704) : 00.01% 09.41% : RegionUsagePageHeap
1000 ( 4) : 00.00% 00.00% : RegionUsagePeb
0 ( 0) : 00.00% 00.00% : RegionUsageProcessParametrs
0 ( 0) : 00.00% 00.00% : RegionUsageEnvironmentBlock
Tot: 7ffffff0000 (8589934528 KB) Busy: 000000012984b000 (4874540 KB)
-------------------- Type SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
7fed67b5000 (8585060052) : 99.94% : <free>
7dd7000 ( 128860) : 00.00% : MEM_IMAGE
2e76000 ( 47576) : 00.00% : MEM_MAPPED
11ebee000 ( 4698040) : 00.05% : MEM_PRIVATE
-------------------- State SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
df283000 ( 3656204) : 00.04% : MEM_COMMIT
7fed67b5000 (8585060052) : 99.94% : MEM_FREE
4a5b8000 ( 1218272) : 00.01% : MEM_RESERVE
那么,99.94% 的内存是 RegionUsageFree 吗?
有人可以揭开上述条款的神秘面纱吗?RegionUsageFree
意味着内存已被free
删除并且可以使用?什么是Private Working Set
手段?
如果免费,为什么显示在Private Working Set
?我应该担心这个吗?该内存可以(重新)使用吗?我在 64 位,OOM 在这里不是问题,在 32 上可能是?我怎样才能减少这个Private Working Set
?
PS:堆看起来不错:
0:022> !heap -s
LFH Key : 0x0000005b29625009
Termination on corruption : ENABLED
Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast
(k) (k) (k) (k) length blocks cont. heap
-------------------------------------------------------------------------------------
00000000000e0000 00000002 1024 8 1024 3 1 1 0 0
0000000003c20000 00001002 512 8 512 3 1 1 0 0
0000000004d40000 00001002 512 8 512 3 1 1 0 0
00000000001e0000 00008000 64 8 64 5 1 1 0 0
00000000070e0000 00001002 64 8 64 3 1 1 0 0
0000000004d30000 00001002 64 8 64 3 1 1 0 0
0000000007010000 00001002 512 8 512 3 1 1 0 0
0000000004d00000 00001002 64 8 64 3 1 1 0 0
000000000c8b0000 00001002 512 8 512 3 1 1 0 0
00000000070b0000 00001002 64 8 64 3 1 1 0 0
000000000ef00000 00001002 64 32 64 27 1 1 0 0
0000000012180000 00001002 512 8 512 3 1 1 0 0
000000000f630000 00001002 512 8 512 3 1 1 0 0
0000000010490000 00001002 64 8 64 3 1 1 0 0
00000000105b0000 00001002 512 8 512 3 1 1 0 0
0000000012170000 00001002 64 8 64 3 1 1 0 0
0000000039860000 00001002 512 8 512 3 1 1 0 0
00000000397e0000 00001003 512 8 512 5 1 1 0 bad
000000003ca30000 00001003 512 8 512 5 1 1 0 bad
000000003dbc0000 00001003 512 8 512 5 1 1 0 bad
0000000010900000 00001003 512 8 512 5 1 1 0 bad
0000000012090000 00001003 512 8 512 5 1 1 0 bad
0000000039730000 00001003 512 8 512 5 1 1 0 bad
0000000010aa0000 00001003 512 8 512 5 1 1 0 bad
00000000136b0000 00001002 64 8 64 3 1 1 0 0
000000000eff0000 00001002 64 8 64 3 1 1 0 0
0000000013590000 00001002 64 8 64 3 1 1 0 0
0000000013850000 00001002 64 8 64 3 1 1 0 0
000000000fd70000 00001002 64 8 64 3 1 1 0 0
-------------------------------------------------------------------------------------