Diablo IV has run out of memory

Those of you running out of memory when playing this game need to adjust for a higher amount of swap file.

The automatic systems in place do not compensate fast enough.

To change this setting:

Windows 10/11

  • Right-click the Windows Start icon (window/flag button)
  • Choose “System”
  • Find the link labeled “Advanced system settings” and click it
  • A window should pop up. On here find “Performance” and click the “Settings” button
  • At the top of the next page, click on “Advanced”
  • Under here you will see the Paging options.
  • Click “Change”
  • Uncheck “Automatically manage paging file size for all drives”
  • Find the dot labeled “Custom size” and click it.

Now, for the next portion, set both boxes to the same value

  • If you have 16GB or less, set the value for both to 24576 (24GB)
  • If you have more than 16GB, set the value for both to 16384 (16GB)

The reason you can use less in the second option is because you have more memory. I run a system with 32GB, a 4080 Super, and use a 16GB Swap file. No crashes. Before I changed that setting, I was using a 3070Ti, and had no swap file set at all. It was disabled. But as soon as I upgraded the card, I had out of memory problems.

Always use only ONE drive for the swap file. Do not put your swap file or setup a swap file on multiple drives! Preferably, just stick with using the same drive as the OS is running on. (C:)

You can monitor your memory usage:

Open the task manager and use the view of your memory usage while playing the game. You can literally see it eat up your virtual memory under “Committed”.

The reason we want to set the minimum and maximum (by using the same value for both) is to reduce the system dynamically having to adjust the file size on the fly all the time. It helps the performance.

Now, your individual results can vary and you may need to set a higher value if you are using a 24GB video card such as a 4090. And if you are running other programs in the background (especially browsers) then set the value higher.

FYI - I am using the calculation of 1024 x the base memory amount (such as 16) to arrive at those numbers, but you could literally input any number value as long as both are the same. I just use that as it feels correct.

13 Likes

I’ll give that a try, thanks. It’s just weird that this hasn’t happened ever until updating yesterday, and doesn’t happen on any other game.

1 Like

Depending on your issue it may help.

Something else that someone brought up in a recent post about Logitech triggered a thought.

I noticed the same update they were talking about here:

It could be related to some of you having issues as well.

I just noticed, it says Initial size and Maximum size, do I change them both to 24576?

Sorry, yes, they should both be set the same value.

That is so the system isn’t trying to dynamically change it on the fly and it minimizes performance impact.

1 Like

I have no clue if this is what fixed it, but after seeing your link I saw I had old Logitech firmware, but it wouldn’t let me update it so I deleted it and installed with the new firmware. I also noticed, after updating my AMD firmware last week, I had another to download today. After updating them both I’ve had no issues in roughly 2 hours. Thank you so much for your help.

Posting my thank You to DTMAce here as well… this fixed it for me. I had been experiencing many crashes for the last week or so. Now, super smooth once again. FYI, my system is a 4090 (24 GB VRAM) and 32 GM RAM, so I went ahead and fixed the swap file at 32768. Maybe it’s overkill, but it’s working now.

This is only true for the 980 Pro models made before a certain date. It’s still wise to get the latest firmware for any Samsung SSD since they usually include bugfixes or workarounds for controller errata.

This is also something I’ve noticed. If you have a browser open, even with just one tab like I typically do for my build for looking up temper/stat priorities, D4 hits the VM error much, much quicker.

It’s been a problem since the March 5th update. For some reason D4 is now dumping textures into virtual memory instead of simply swapping them to system RAM when able to, and you end up with a out of memory error, and if you check the Fenris logs it shows a virtual memory error. D4 shouldn’t be dumping textures into VM. Ever. It’s much more noticeable now because modern GPUs have a lot more VRAM and as such, soak up the available VM pool much more quickly. A 4090 will actually reach that error much sooner than even a 4080 and a lot sooner than a 4060 or 4070.

Keep in mind, I was seeing this back in January, after upgrading to the 4080 S, so I don’t think that date is when it started, but it may have been made worse or more prevalent when that patch happened. Just a thought. And you had actually commented about this and pointed me to the fact that it was a VM issue, if you remember. :stuck_out_tongue:

Ahh, so this is still a thing. I was in 2 of the betas, no problem. Release, random out of memory. There was a patch, no more errors. A couple patches later, memory errors, etc. I havent played since Season2 started. I just installed, pick a character, set the name, load in, and out of Memory again.

ryzen7 5800x, 32gb ram, 3090rtx w/24gb ram. No issues with Elden Ring and Street Fighter 6, or I play something every day, no memory issues.

1 Like

Set textures to medium and test. Set Battlenet to close on launch. Download afterburner and check vram while adjusting textures.

Ooph im running the 5700 and i dont have those issues so given your cards newer id say theres something up with your machine, grahpics wise try the AMD Pro drivers .there older but way more stable when it comes to D4

As an IT 3rd Level tech of 30 years i can indeed say that is a memory leak from Blizzard. Running a i9-14900ks with a 4090 all graphics turned on to the maximum. It could be something to do with Nvidia’s current drivers and Blizzards software (not a software tech) implementation. Only game that i play that runs out of memory often. This is nothing new with Diablo games. Hopefully with a few more patches they figure it out. Generally goes away once they have patched some of the issues.

It isn’t a memory leak. It’s the game dumping textures into virtual memory instead of system RAM when doing texture swaps and the default VM page size in Windows being too small to handle a full-on dump of all textures on a high VRAM GPU.

The only known workaround is to increase the Windows VM page size to at least the amount of VRAM your GPU has. That means for say, the 4090 I have, 24 GB. That also means you need at least 2x the space for the new VM page size in free space on your boot SSD to accommodate the bump in VM size.

I just found a solution. I was crashing every 10-20 minutes. I noticed I had Pagefiles on all my SSD, except the one where D4 was installed… Sigh. So I just set a Pagefile on that SSD, and I was able to play for 1h30 minutes without any crash. It’s worth checking.

Quoted from above. This will fix most memory issues and give you a performance bump.

Couple of notable mentions:

I would configure your virtual memory space (swap file space is your physical memory and swap file size combined).

Keep in mind, your virtual space is a combination of both physical RAM and swap file allocation.

So as example:

You have 32GB of memory, and your video card has 16GB. Set the swap file to 16GB, that will give you 48GB of virtual space.

You should NEVER split your swap file across drives. Use one drive, preferably the one the OS is on, and hopefully the fastest one.

4 Likes

I know. I have 4 Samsung 990 Pro, 64 Gb of RAM, Nvidia 4090. I had a 32 Gb Pagefile on my OS drive. And I was crashing in D4. I just set a Pagefile on the disk with my D4 installation, and I didn’t had another crash since then.

Have you ever monitored the virtual memory usage (Committed memory) while playing? Maybe you were hitting the ceiling before.

It makes no sense that putting a swap file on the drive where the game is would help. Like at all.

Now if you did that and it increased the available virtual space, that would make sense. But to prove it, you could remove the swap file from that drive and then increase the size of the one on the original drive to see.

But knowing how it works, that makes absolutely no sense as to why it would help. I mean none at all.

And having the swap file spread across drives actually can increase the chance of a crash if one of those drives hiccups while holding memory data.

It makes no sense but it worked. Now 8 hours without a crash. So it’s worth a try for those still having problems. I know it’s not logical, but it did solve those crash for me. :slight_smile:

I have the same issue.
It crashes with the error that has run out of memory.
I have 32GB RAM and RTX3060 12GB.
I had never had that issue before the expansion.
This is so frustrating.