I came across this post a while back and decided and try it out today, but having some trouble getting it to work. The script is supposed to trim the memory periodically, but it looks like the file the poster uploaded isn’t entirely complete. I tried following with the video and completing the script but I failed to get it working. If anyone wants to give it a try and if successful upload the completed file somewhere it would be much appreciated.
Try not using the 4k graphics if you cannot handle the 4k..they look nicer but this probably your best bet at why you are having a memory leak. D4 uses alot of CPU and GPU resources. I found a free CPU limiter program and put diabloIV.exe into using only 90% of the CPU or you can (if you know how to) set it to use 1 less CPU upon use.
Also read some of the comments, they tell you how to fix this script.
scripts? uploader? i guess better don’t use 3rd party software to meddle with Diablo IV.exe to risk for banning.
instead, i use windows own setting. just try kind of control panel… > power options > change plan settings > change advanced power settings, then expand processor power management and adjust the maximum processor state percentage to 99%.
this reduction of 1% cpu state magically reduces resource utilization of the game and runs at around 40-ish °c on both cpu and gpu. no more crashing with memory thing.
Thanks, yeah, I got the script working after a messing around a little more and it’s pretty sweet.
CPU limiter was one of the things I tried last year, and it helped, but it just extended the crashes from every 15 minutes to every hour. Maybe will play next season and test this out, or maybe just mess around nonseasonal for a day or two this summer.
I play with it on 1080p and use FSR2, not on 4K, but only 16GB ram, which I typically reach within 5 minutes of opening the game.
RAMMap is Microsoft’s own RAM examination and relinquishing tool. It can free up RAM that the OS and/or game isn’t freeing up on their own. That said, using it while D4 is running is very dangerous. You generally don’t want to be actively using an app while simultaneously clearing out cached RAM it is using. RAMMap64 is best used after closing down an app so you can reclaim the standy list (e.g. cached items and prefetched data). It’s the tool I used to get my RAM back when WoW was leaking during the Legion Remix event and bringing the game to <10 FPS.
You won’t get banned by Blizzard using this tool as it is for memory management and does not directly read the game’s stack heap for specific data - it only reads the memory lists so that it can sort which addresses have which type of list item.
FWIW, the only really “safe” list to empty is the standby list. Leave the others alone.
D4 doesn’t have a memory leak, it has a very poorly designed method of swapping textures. Instead of dumping unused textures to RAM (which would put them in the standby list, a.k.a. cached items), it dumps them to virtual memory. The larger your VRAM pool on the GPU, the more likely you are to run into an “out of memory” scenario because D4 causes a much larger chunk of VRAM to be dumped all at once than the Windows dynamic VM allocator can handle. This is especially bad on the 4080/4090 and 5080/5090 class cards.
The only real way to avoid the issue with D4 running out of virtual memory (which is the actual problem here), is to manually set your Windows minimum pagefile size and maximum virtual memory size to be the same using the following formula: (VRAM + 0.5 * System RAM total). So if you have a 4090 with 24 GB VRAM and 32 GB system RAM like I currently do, that would be (24 + (0.5 * 32)) which equals 40 GB. That means the VM pagefile size and maximum VM size need to be 40 GB on this system. This will lock off that much of your SSD, but it does prevent D4 from dumping too much at once for the VM system to handle since the allocation size will exceed anything the game can dump in one go.
If the script is only interacting with RAMMap64, it isn’t a problem in that regard. But again, it isn’t exactly wise to do so while the game is running even when doing so manually as wiping cached data can actually cause game hiccups at best when the game needs data it thought was cached but is no longer cached, or at worst, corrupt the game files if the RAM holding the cached version of those files is wiped at the same time the game app is reading those files. That’s why the only truly safe time to use RAMMap64 is in between game launches to free up RAM that isn’t actively being read.
This is actually a nice fix. I would not mind to reserve even more on my SSD.
I have a 1 TB & 2 TB SSD and i only have a pawful of games installed at the same time.
Maybe i should jump into the fires of hell on Pc too. So i can choose between sofa/big screen/home cinema play to tiny 27" oled monitor, hard wooden stool and nice genelec 8030/7050 play.
What do you people think?
Monkey now totally M.A.D.
Quick!!! Hes vulnerable now!!! Lock him into a blue jewel!!!
Yes… buy DIV again so you can rant about Console AND Pici Version
in the middle of diablo 4 running, it cuts away a chunk of its memory in the name of freeing memory to avoid leaks. it sounds kind of reckless. this sort of memory cleaning needs some administrator knowledge to bring down certain services, run it via shell, and bring the services back up.
well, i hope this could convince blizzard’s detection program that the user is not purposely degrading blizzard’s product performance to create the impression that the product is substandard.
this sort of action is sensitive. maybe blizzard would rather ban this potential threat than, in good faith, let everyone cut out a chunk of its program execution. whoever using this should weight the risk though.
I agree with you about the 4K part. When I play Diablo IV it only uses between 5%-15% max GPU and about 5-7% CPU, and between 10%-15% memory. Then again, my computer is a workstation powerhouse and I have my graphic settings to max, so I barely notice any resources being used when playing, which is nice.
But I can see how this can affect personal PCs, especially if they are low on resources. Thanks for sharing. - JJ -