Is 5Gigs of ram usage normal?

I seem to have been getting a ton of ram usage from heroes lately. I usually sit at around 1.5 gigs in any given game, but lately it’s up to 5 gigs, and because I have other applications running, this pretty much maxes out my available ram, causing fps drops. Sure, the easy solution would be to upgrade my ram, and I plan to do so, but is this not an issue?

This seems like a memory leak to me if anything.

1 Like

It starts at around 1.4GB however HotS caches assets as it plays to decrease loading times. This can cause memory usage to increase as time goes on. It technically is not leaking since the memory will be reused when the assets are next loaded. Diablo III does something similar since the x86-64 build.

In theory the way virtual memory works should keep the game running smoothly since assets in the cache that are not in use would be written out to the virtual memory page file in times of low free memory. In reality this probably only works well if you are using a SSD to back the page file.

Ultimately the only perfect solution is more memory. However until that is possible you could try lowering texture quality by a level which should hopefully decrease the amount of memory needed by the cache to cache textures. As textures are one of the largest memory users of HotS, it should make a difference to total memory usage and hopefully prevent page thrashing from occurring too frequently after long play sessions.

Of course the other solution would be to restart your client every 2-3 matches. However this certainly is less than ideal, especially if you are in a party.

True, I didn’t think about caching, but I think that’s way too optimistic for a large game like this? I’m sure they have proper set limits as to how much to cache, but 5 gigs of cache is rather large. I guess I’d like to know what exactly is being cached (hero models, map data), but that’s another topic. However I can say that the caching will probably only have a minimal impact on load times since you could have a completely different roaster and different map in the next game. The worst case is gigs of information cached every session.

Despite this, I experienced high memory usage in just the first game since client load. I’m not sure this is a caching issue unless I’m caching way more than what’s actually being presented.

Lowering texture quality may help a little bit, but texture really isn’t stored on motherboard ram as it is stored in VRam on your GPU. Some of the caching could even be done on the GPU as well, which is another thing I’m a little confused on.

Overall, Heroes still feels unoptimized.

1 Like

Not for Blizzard. Diablo III 64bit is known to use over 6GB of memory due to its caching.

After 3-4 versus AI games with human allies my ram usage for HotS was at ~2.6GB. If under similar load you are getting 5GB then something probably is wrong, possibly a driver leak?

It is possible CASC uses memory mapping for improved IO performance. As such some of the virtual memory HotS allocates might be shared with the OS file cache.

I originally ran HoTS on 6GB of memory back on Windows 7. However when I upgraded to Windows 10 6GB was not enough and there would be performance problems after long play sessions, especially due to practically no file cache. After upgrading to 18GB the performance problems went away.

All textures have to first be loaded into memory before the buffers can be transferred to the GPU. Since GPU memory is often more scarce than CPU memory it makes sense to unload textures and keep them cached in the main memory.

I do agree that the caching behaviour used is sometimes not optimum. For example Diablo III 64bit never evicts from the cache as far as I can tell. I have experienced it allocating over 6GB of memory after visiting most areas. I would not be surprised if HotS also has such aggressive caching, hence after a lot of matches with unique and different content memory usage could become quite high.

A lot of games are starting to use over 5GB of memory now. Since modern gaming computers have at least 16GB of memory (older ones 8GB) I think they added the cache to at least try and take advantage of all that memory to reduce load times.

Going to echo DrSuperGood here and say yes, this is normal, and it’s due to caching as earlier mentioned.

Heroes has a LOT of files to potentially cache, and to keep your load times lower, it does so. Your RAM is really good at keeping infromation at the ready, while your harddrive, even with a SATA SSD, is not as good. RAM holds files to be accessed quickly. Playing on a map? We’ll cache some info on the map to speed up the next load. Playing on heroes with a couple different skins? Those are getting cached too.

If at any point you decide your RAM usage is too high, you can always restart the game or PC to clear the RAM cache, but the way it works currently is intended. Obviously if we max out your RAM somehow we’re going to have to dump some of that old unused information, but we assume if you’re playing for an extended period of time you’d like your game to cache information for those quicker loads and faster responses when in game.

I can’t speak to all the reasons here, as I am not a developer, but I just wanted to let you know there’s not really anything directly ‘wrong’ with the behavior you’re experiencing. If you end up having some kind of performance problem at high levels of RAM usage that’s totally something we can look into. Otherwise, we’re literally just using RAM for one of its intended purposes.

Although I cannot confirm it is still the case (as I upgraded to 18GB of memory), in the past there certainly was a problem where the HotS asset cache would degrade performance after extended periods of play. I noticed it shortly after upgrading from Windows 7 to Windows 10 with 6GB of memory due to the increased memory usage of Windows 10 over 7. The symptoms were very much those of page faults, where when new assets were needed there were frame drops.

These symptoms are quite similar to what the topic creator describes, and would make sense to be the same cause as 6GB minus 1GB for Windows 10 would be 5GB, the size of HotS being reported.

Without knowing the full details of the caching a rough guess is that there are 2 problems which can occur when a system has insufficient memory for this type of caching used.

  • Page thrashing. When out of free memory the cached data itself must be written out to the page file before more data can be read in. Writes are a lot slower than reads, and potentially both have to be done to potentially the same drive which could be a mechanical drive. Every new asset loaded, eg a sound or special effect, suffers from this and the delay can be large enough to cause frame drops.
  • File cache degradation. Unless explicitly instructed when manipulating a file, the OS will automatically cache read/written file data in the file cache by taking advantage of memory mapped IO mechanics. File data which is already inside the file cache can be read extremely quickly, far faster than even high end PCIE SSDs as it is operating at RAM speed (minus some kernel overhead). By HotS using most of the available memory for its own caching, it is forcing the OS to evict data from the file cache which will degrade performance of files which are sporadically read. This is especially important for mechanical drives which depend on the file cache to help smooth over the poor random access qualities of such drives.

Technically the current solution is technically the best for load performance. Even though the file cache will cache read data so subsequent reads return near instantly, that data is still compressed and so has to be decompressed before use which is computationally intensive resulting in a CPU bottlenecked load time. With the assets already decompressed sitting inside the program memory they can be instantly used with minimal CPU overhead. Even though 5GB is a lot of memory, it is nothing for recent gamers who should have at least 8GB of memory, if not 32GB.

The problem is that for people with less than 8GB of memory or who need to use a lot of memory for other tasks the caching can end up doing more harm than good. For example when such caching was introduced to Diablo III with the 64bit build a lot of players on 4GB memory systems found the 64bit build to be unplayable, despite it offering a vast improvement in load time performance for those who had enough memory.

Ultimately what I do not understand is why the cache size cannot be configurable to effectively get the best of both worlds. For modern gamers they can use the current cache size (infinite?) for best performance. For gamers who are more memory limited they can limit it to 1-2GB to get some of the benefits the cache offers without running into the performance problems associated with running low/out of free memory.