[1.4.9] Bad memory leak with Temporal Warden

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

[1.4.9] Bad memory leak with Temporal Warden

#1 Post by jenx »

Once I get Warden's Call up and running, the memory leaks with TWs go through the roof. I can hit 1.5 Gb of memory use easily.

This happens even when I'm just hitting training dummies, so it can't be due to npcs.

Can this be looked at please? Others have reported it also I believe.

I suspect it is the clones that cause the problem.
MADNESS rocks

Effigy
Uruivellas
Posts: 970
Joined: Fri Oct 10, 2014 4:00 pm

Re: [1.4.9] Bad memory leak with Temporal Warden

#2 Post by Effigy »

I spent a lot of time trying to figure out what is causing the problem, but without much luck. It's almost definitely the clones, but the hard part is knowing why. It's likely due to some reference being held so they leak memory, but I couldn't find where that was happening.

Effigy
Uruivellas
Posts: 970
Joined: Fri Oct 10, 2014 4:00 pm

Re: [1.4.9] Bad memory leak with Temporal Warden

#3 Post by Effigy »

Restarting the game will temporarily fix the issue, although performance will still go down after playing a while.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.4.9] Bad memory leak with Temporal Warden

#4 Post by jenx »

Effigy wrote:Restarting the game will temporarily fix the issue, although performance will still go down after playing a while.
That's true. Unfortunately, I have to do this several times per dungeon level now :-(
MADNESS rocks

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.4.9] Bad memory leak with Temporal Warden

#5 Post by jenx »

Is there anything that can be done about this darkgod? please ???
MADNESS rocks

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.4.9] Bad memory leak with Temporal Warden

#6 Post by jenx »

It seems to be much worse when I shoot and the clone hits with melee weapons that put talents on cooldown (forgetfulness ego). Could the leak be to do with not the clones themselves but info about the npcs hit by clones?

just trying to help.... (saving and restarting 5-10 times per level is really a grind :-()
MADNESS rocks

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: [1.4.9] Bad memory leak with Temporal Warden

#7 Post by darkgod »

As Effigy said, must time has been spent on that without sadly much results :/ I still check it from time to time in the hope to find where things are actually borking but .. heh :/
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.4.9] Bad memory leak with Temporal Warden

#8 Post by jenx »

darkgod wrote:As Effigy said, must time has been spent on that without sadly much results :/ I still check it from time to time in the hope to find where things are actually borking but .. heh :/
I can't program much, but is there any testing I could do to help track down the cause of the problem?
MADNESS rocks

Effigy
Uruivellas
Posts: 970
Joined: Fri Oct 10, 2014 4:00 pm

Re: [1.4.9] Bad memory leak with Temporal Warden

#9 Post by Effigy »

My investigation mostly involved searching for all places that the entity ID of the clone can be stored, then making sure it gets manually removed after they die or it's stored in a weak table so it gets garbage collected automatically. All the places I could find fit these criteria now, although it's definitely possible that there is some obscure field still holding a reference.

The secondary measure is damage control, i.e. reducing the amount of memory the clones take up. I changed the cloning system so it doesn't copy irrelevant data from the player to the clones. This is mainly to reduce performance degradation over time, although it probably helps short-term performance a little as well.

The problem should be solvable, but in a mature game like this there are all kinds of possible interactions between different pieces of code so it's hard to be 100% sure you've covered all the bases.

Patashu
Higher
Posts: 74
Joined: Tue Dec 18, 2012 3:54 am

Re: [1.4.9] Bad memory leak with Temporal Warden

#10 Post by Patashu »

If you're trying to figure out why a C# object is memory leaking, you can attach .NET Memory Profiler and take snapshots. For each object that is live, it shows the chain of strong references from some root that keeps it alive, and that helps you figure out what is still holding a reference to it.

Is there an equivalent program written for {insert language ToME4 is written in}?

Mordy
Archmage
Posts: 300
Joined: Tue Feb 10, 2015 1:41 pm

Re: [1.4.9] Bad memory leak with Temporal Warden

#11 Post by Mordy »

Patashu wrote:If you're trying to figure out why a C# object is memory leaking, you can attach .NET Memory Profiler and take snapshots. For each object that is live, it shows the chain of strong references from some root that keeps it alive, and that helps you figure out what is still holding a reference to it.

Is there an equivalent program written for {insert language ToME4 is written in}?
When I tracked memory leaks in Python, I just made a test environment where no object of a certain type should exist (or a controlled numbers) and I threw scripts that went over all the objets in the interpreter to find who was referencing the culprits :D

Though Tome is in lua and the standard library probably has less tools by default than Python looking at their respective size.

Post Reply