Open MoeMod opened 1 year ago
In theory, we could use MAP_PRIVATE here, but I'm unsure about compatibility issues it can bring.
We could make testing branch with such changes, but then why you even need to make models this big?
It can be useful in multiplayer mods with many weapon models like Counter Strike.
Our 1.6 GB apk has tons of models and sprites to load. Peak memory usage is 6GB (PSS) on Android and 2.6GB (Xcode) on iOS. Newest phone including even chinese phones with 8GB+ RAM can crash by OOM. We had tried these ways to reduce memory usage:
https://github.com/FWGS/xash3d-fwgs/blob/ddc4d7666874ce050d33ba6cc5781f08180776c5/engine/common/mod_studio.c#L1093-L1096
Every model file loaded into memory with read+malloc+memcpy can be replaced with mmap, which helps to reduce physical memory usage for huge mods.