求生之路2 heapsize啟動(dòng)項(xiàng)設(shè)置
靈感來源于https://www.bilibili.com/read/cv22642688。

這里是V社給出的heapsize的注釋:Specifies the heapsize (in kilobyte) the game will use. This no longer exists on later version of? Source 2009 and? Source Multiplayer.?大概意思是指定游戲使用的堆大?。▎挝籯b)

剛剛測試了下,在游戲里用mem_dump看內(nèi)存分配情況。
heapsize在524288(1024 * 512) -?2097151(1024 * 1024 * 2 - 1)之間指令都能正常工作,
超過524288后除WaveData(似乎是音頻文件?)外其余幾項(xiàng)(模型文件等)都達(dá)到最大值,
在2097151下WaveData達(dá)到最大值(512.00 MB)。
heapsize達(dá)到2097152時(shí)游戲似乎無法正確調(diào)用內(nèi)存,開戰(zhàn)役也會(huì)直接閃退。
按照cv22642688里的方法設(shè)置(6000000,9000000,18000000等都試過),這幾個(gè)超過2097151的值都被截?cái)嗔耍透偷闹禌]有區(qū)別。
這樣看來2097151是配置允許的情況下,能設(shè)置的極限了。
不知道524288和2097151在實(shí)際游戲中有什么區(qū)別 XD

總結(jié)
設(shè)置為524288即可
heapsize上限為2097151,實(shí)際上設(shè)置524288分配給模型文件等的內(nèi)存已經(jīng)達(dá)到最大值,再往上加也只有增加音頻文件的緩存。當(dāng)然配置允許可以直接拉滿。

以下是各個(gè)參數(shù)的情況
524288:
] mem_dump
Writing memory stats to file memstats.txt
Operating system reports Available: 4064.00 MB, Used: -32.00 MB, Free: 4096.00 MB
Internal heap reports:? 0.08 MB (81364 bytes)
Hunk Memory Used :
Total used memory:? ? ? 16
Total committed memory: 33554432
Datacache reports:
Section [ModelData]: 0 resources total 0 bytes, 0.00 % of limit (512 MB)
Section [ModelMesh]: 0 resources total 0 bytes, 0.00 % of limit (512 MB)
Section [AnimBlock]: 0 resources total 0 bytes, 0.00 % of limit (512 MB)
Section [ColorMesh]: 0 resources total 0 bytes, 0.00 % of limit (512 MB)
Section [Captions]: 0 resources total 0 bytes, 0.00 % of limit (64 KB)
Section [WaveData]: 1 resources total 1.40 MB, 1.09 % of limit (128 MB)
Summary: 1 resources total 1.40 MB, 0.27 % of capacity
2097151:
] mem_dump
Writing memory stats to file memstats.txt
Operating system reports Available: 4064.00 MB, Used: -32.00 MB, Free: 4096.00 MB
Internal heap reports:? 0.08 MB (82431 bytes)
Hunk Memory Used :
Total used memory:? ? ? 16
Total committed memory: 33554432
Datacache reports:
Section [ModelData]: 0 resources total 0 bytes, 0.00 % of limit (512 MB)
Section [ModelMesh]: 0 resources total 0 bytes, 0.00 % of limit (512 MB)
Section [AnimBlock]: 0 resources total 0 bytes, 0.00 % of limit (512 MB)
Section [ColorMesh]: 0 resources total 0 bytes, 0.00 % of limit (512 MB)
Section [Captions]: 0 resources total 0 bytes, 0.00 % of limit (64 KB)
Section [WaveData]: 1 resources total 1.48 MB, 0.29 % of limit (512.00 MB)
Summary: 1 resources total 1.48 MB, 0.29 % of capacity
2097152:
] mem_dump
Writing memory stats to file memstats.txt
Operating system reports Available: 4064.00 MB, Used: -32.00 MB, Free: 4096.00 MB
Internal heap reports:? 0.08 MB (81367 bytes)
Hunk Memory Used :
Total used memory:? ? ? 16
Total committed memory: 33554432
Datacache reports:
Section [ModelData]: 0 resources total 0 bytes, 0.00 % of limit (1,024 KB)
Section [ModelMesh]: 0 resources total 0 bytes, 0.00 % of limit (1,024 KB)
Section [AnimBlock]: 0 resources total 0 bytes, 0.00 % of limit (1,024 KB)
Section [ColorMesh]: 0 resources total 0 bytes, 0.00 % of limit (1,024 KB)
Section [Captions]: 0 resources total 0 bytes, 0.00 % of limit (64 KB)
Section [WaveData]: 1 resources total 1.53 MB, 0.30 % of limit (512 MB)
Summary: 1 resources total 1.53 MB, 153.28 % of capacity