欢迎光临散文网 会员登陆 & 注册

求生之路2 heapsize启动项设置

2023-08-13 22:52 作者:回忆所在之处  | 我要投稿

灵感来源于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. 大概意思是指定游戏使用的堆大小(单位kb)

developer.valvesoftware.com/wiki/Command_line_options


刚刚测试了下,在游戏里用mem_dump看内存分配情况。

heapsize524288(1024 * 512) - 2097151(1024 * 1024 * 2 - 1)之间指令都能正常工作,

超过524288后除WaveData(似乎是音频文件?)外其余几项(模型文件等)都达到最大值,

2097151下WaveData达到最大值(512.00 MB)

heapsize达到2097152时游戏似乎无法正确调用内存,开战役也会直接闪退。

按照cv22642688里的方法设置(6000000,9000000,18000000等都试过),这几个超过2097151的值都被截断了,和更低的值没有区别。

这样看来2097151是配置允许的情况下,能设置的极限了。

不知道524288和2097151在实际游戏中有什么区别 XD

总结

设置为524288即可

heapsize上限为2097151,实际上设置524288分配给模型文件等的内存已经达到最大值,再往上加也只有增加音频文件的缓存。当然配置允许可以直接拉满。


以下是各个参数的情况

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


求生之路2 heapsize启动项设置的评论 (共 条)

分享到微博请遵守国家法律