nipkownix / re4_tweaks

Fixes and tweaks for the "UHD" port of Resident Evil 4
zlib License
340 stars 32 forks source link

Fix Crash When The Game Exceeds 2Gb of RAM #576

Open DarthxVoid opened 1 year ago

DarthxVoid commented 1 year ago

One of the random crash that happens in the game is when it reaches 2Gb of RAM, even with the 4Gb Patch this bug continues, I don't know if it would be possible to put a way that when the game reached 1.9Gb of RAM it would dump the memory, and restart from 0Gb so as not to crash the game

emoose commented 1 year ago

Do you have any crash log/dmp file for when that happens? Only guess is maybe some part of the game is treating pointer as a signed int instead of actual pointer (which wouldn't be too surprising, they use int a lot in the structs IIRC), then crashing once it goes past the 2147483647 maximum for signed int & overflows to -2147483648.

DarthxVoid commented 1 year ago

I can try to force this crash, who really discovered this problem and commented on it was Mr Curious, and this causes if you play a mod for a long time, and it happens very often in those who play mods with secondary spawn like arrange it because even killing all enemies the game memory does not empty And this crash has been happening very often in my mod, then maybe there would be a way to dump in the memory

This is a print that Mr Curious posted on RE Modding's Discord when the game crashes due to memory overload

7MpSZl

Mister-Curious commented 1 year ago

I posted a guide for how to tweak the memory issues HERE

I also posted information about how to prevent the Companion DLL from wasting memory HERE