Memory leak in PVP?

I started noticing that for some time now the Gem Of War process uses a lot of memory when I’m playing PVP.
I play Steam version on Windows 7. (I don’t know if it matters, but I have Full Screen setting unchecked).

Windows Task Manager shows the following for GemOfWar.exe process:

(just for comparison)

  • on fresh start - 358704K
  • after over an hour of playing Challenges for one kingdom (from II to X, 7x9=56 battles) - 573349K

(restarting the game)

  • on fresh start - 353672K
  • after 15 min of playing Ranked PVP (14 battles) - 867980K

So, at this rate, it goes pretty fast to using far over 1Gb memory and to a point that my computer starts to be ‘sluggish’.

Is it just me? Anybody else has the same problem? Or is it normal?

5 Likes

Not just in PVP.
GoW starts to seriously degrade (or memory leak) after running for 2 hours straight. Images don’t refresh like they’re supposed to. Matches take longer to load. Casts become laggier specially if it’s the hero casting. That’s all I can think of off the top of my head. But a common occurrence at least since 3.4.5 was introduced.
I don’t know much about coding.
But I imagine they keep adding things to the game, but aren’t doing the necessary steps to reform the infrastructure to support all these new editions for long term play on in one sitting. I assume all the modes are tested by QA for about a hour. And if it meets that bench mark then they consider it good to go. These are all purely my assumptions though and should not be taken as more or less than that.

4 Likes

It could be a problem. For really complex reasons, memory patterns in C#-based programs (GoW = Unity, which uses C#) don’t behave like you’d think computer programs behave.

Put simply: normal programs ask for memory when they need it and give it back when they are done. If you watch their memory usage on a graph you’ll see it fluctuate up and down. A memory leak is a really clear upward trend. C# programs ask for more memory than they need up-front and tend to stay at that level constantly. If the program needs more they ask for another big chunk. So it’s typical to see a “stair step” pattern in a C# program’s memory usage graph unless you have a profiler specifically built for C# code. A leak still shows an upward trend but it takes longer to detect; a “normal” program should plateau at some point and stay steady.

On my aging iPhone 7 I’ve seen performance woes come and go. This version seems to slow down every now and then and I hadn’t noticed but it might be specifically in PvP. I’ve been doing Tower of Doom a lot the past few days and haven’t seen stuttering, but earlier in the week I was doing more PvP and remember noticing some hiccups.

2 Likes

They should fix this. It starts to get noticeable when you’re playing for over 1 or 2 hours.
The starting board will not drop evenly or at the same time, it will be like some sort of lag delay, same goes for the effects and the list of destroyed troops, from up to bottom, etc.

I had to wait for over 3 minutes (gems loading bar) and I did not get bad gateway message, just because the game wanted to refresh somehow, but had issues.

@Saltypatra @Kafka @Sirrian
I hope that you address this issue or notify the Unity Support Team to fix this issue.
Restarting the game every hour or two gets old fast.

I’ve suspected there’s a memory leak for a long time on my Android phone given the way it bogs down after a long play session, but I’ve never been bothered to check the memory usage in detail to provide the evidence.

It’s a PITA having to restart the game or close it if I want to use another app, but there isn’t enough memory for it to run properly :frowning:

Actually @Cyrup helped me a lot with that when she joined the staff. I thought checking discord in between matches just meant that GoW could crash and nothing could be done about it. But GoW on mobile is designed for you to be able to switch apps and not experience a crash. I’m sure it comes down to how powerful your device is. But since I only ever use the latest and greatest… It was quite ridiculous. And I haven’t had any issues like that since she helped me. So I suggest submitting a technical issues ticket… It may very well be worth the time it takes.

I guess one reason I might not have noticed it is on my iPhone 7 (which is aging), the app tends to restart if I so much as sneeze at another app. And 1/3 of the time it restarts, it crashes. So I tend to restart it a lot (or just play other games on my break since I can be inside their matches faster than it takes GoW to load the loading logo, load the loading screen, load the popup, get to the map, then tap on a popup, then tap on a flash offer, then tap on a popup, then select PvP, then load the opponents, then load a match.)

When you check the analytics logs, do you see a process that is responsible for most of the crashes? I’ve submitted logs to Kafka before, so perhaps a bunch of logs would contain actionable information that the coders could use to track down the cause of the crash.

To clarify: I can have other apps running (usually either Firefox or Twitter), but they appear to start seriously bogging down after I’ve played GoW for a while, to the extent that I have to close GoW to get them running at a proper speed again.

If I try to have both open (or one and another app, eg reading text messages or taking a phone call) next time I go into GoW it restarts which can result in a Delve failing or a GW game being counted as a loss :frowning:

How’s about you walk me through that process (maybe in DM to not clutter up the thread) and I’ll give it a go?

Immediately on start, it goes to 512Mb and then steadily climbs up for me on Win10 Pro-64. It seldom gets over 1Gb. There are two processes, one is 32-bit GoW exe and another is Unity crash handler, also 32-bit. In general, Win10 or any 64-bit OS cannot accurately track memory used by 32-bit apps. So, I would presume that the allocation is dynamic but Win10 cannot clear the memory as needed in a normal fashion like it does for regular 64-bit apps. So, apparently, the game has a cap at which it may attempt to clear the memory but prior to reaching that cap, it just does not bother. This means that loading of whole thing, including of all assets, which are used in various game modes is relatively intense and may take more memory than reasonable. So, IMHO, it is all working as intended more or less.

I have no issues with spikes, local lag, excessive cpu usage, reaching 2Gb+ RAM, etc, etc. So, IMHO, it is as good as it can reasonably get considering how the engine allocates memory.

Oh, and no, I think, there is no large memory leak. If it leaks over a certain limit, the engine tries to clean up the memory. It may lag on lower end on glitchy machines, IDK.