Jump to content

Might A19 have a memory leak?


Recommended Posts

If I leave 0AD Alpha 19 running, even if paused, the memory usage keeps going up. Left overnight it consumed my 8GB RAM + 8GB swop partition.

Build: 26 Nov 2015 (17298P-release)

Linux

Xubuntu 14.04

AMD processor

I have just loaded a saved game, paused it, and watching the memory usage it is going like this:

14:55:30 634.9 MB

14:56:00 653.1 MB = 18.2 MB increase in 30 seconds

14:56:30 671.7 MB = 18.6 MB increase in 30 seconds

14:57:00 689.3 MB = 17.6 MB increase in 30 seconds

14:57:30 707.4 MB = 18.1 MB increase in 30 seconds

14:59:30 781.0 MB = 74.4 MB increase in 120 seconds

15:01:00 834.7 MB = 53.7 MB increase in 90 seconds

so it is gobbling RAM at about 36 MB per minute.

  • Like 1
Link to comment
Share on other sites

I've seen that happen in the past, only it was with the map Editor.

I've opened 0AD and it is sitting at the opening menu. Without doing anything else I can see its memory usage creeping up every second.

In the time it has taken me to write this reply it has gone up by ... checks ... 16 MB.

Edit: It is still on that screen with the family scene that slides back and forth left and right and has now gone up by 50 MB. Something's not right.

Edited by SandJ
Link to comment
Share on other sites

Part of what you describe seems normal. The Javascript engine, for example, schedules a Garbage Collection (GC) regularly. During GC, it reclaims unused memory, but it only gives it back to the operating system from time to time. If I remember correctly, it should not go beyond 400 MB, though. But there are other parts of the game that do similar things like the VFS (virtual filesystem). The VFS keeps some data in the cache because it takes longer to load it from the disk than loading it from memory.

So it doesn't work to look at memory usage in the first few minutes after the game is started and then calculate a memory growth rate based on that.

But...

Left overnight it consumed my 8GB RAM + 8GB swop partition.

This must not happen and is a bug.

When did this happen? Was it in the menu, in the multiplayer lobby or during a game? If it was a game, was it paused?

Link to comment
Share on other sites

Was it in the menu, in the multiplayer lobby or during a game? If it was a game, was it paused?

It was during a paused game against the AI. I have never played multiplayer.

When I am playing after a while the swop partition starts filling up and slowing down the PC so I save the game, exit, reload the saved game and carry on.

I'll try to reproduce it:

Before loading 0AD: 4.7 GB of RAM used of 7.8 GB and 316 KB used of 8.0 GB of swap.

Loaded 0AD, loaded a saved game, then paused it.

14:01 There's 5.3 GB of RAM used of 7.8 GB and 312 Kb used of swap. Pyrogenesis process using 665.3 MB of RAM.

14:17 There's 5.8 GB of RAM used of 7.8 GB and 3.4 Mb used of swap. Pyrogenesis process using 1.0 GB of RAM.

14:48 There's 6.3 GB of RAM used of 7.8 GB and 3.7 Mb used of swap. Pyrogenesis process using 1.5 GB of RAM.

16:16 There's 7.3 GB of RAM used of 7.8 GB and 279.6 Mb used of swap. Pyrogenesis process using 2.8 GB of RAM.

17:38 There's 7.4 GB of RAM used of 7.8 GB and 999.5 Mb used of swap. Pyrogenesis process using 4.1 GB of RAM.

18:00 There's 7.5 GB of RAM used of 7.8 GB and 1.1 Gb used of swap. Pyrogenesis process using 4.3 GB of RAM.

Exit the game.

18:01 There's 3.2 GB of RAM used of 7.8 GB and 1.0 Gb used of swap. Pyrogenesis process has gone.

So 0AD went from 660 MB to 4.3 GB over 4 hours while paused.

Graph showing fairly linear progression over four hours is attached.

post-16325-0-52781100-1450030351_thumb.p

Link to comment
Share on other sites

  • 3 months later...

At last found the issue, this is major bug as w/o swap the game crashes when you try to save it, sometimes it crashes when playing on very detailed map for some time. Playing on low-end is not recommended I believe but as your fan base is getting bigger and bigger by everyday this should get fixed in new build. Looking forward to some stable release as this is top-notch RTS for tux users. :fingers crossed:

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...