tdsharp icon indicating copy to clipboard operation
tdsharp copied to clipboard

TDLib.Samples.GetChats.csproj memory leak

Open AliaksandrZhloba opened this issue 3 years ago • 5 comments
trafficstars

Hello. I cloned the repo, ran TDLib.Samples.GetChats.csproj and found that memory consumption increases even without any application activity:

image

I tried to remove getting channels code from the sample - the result is the same.

Can it be a memory leak?

tdlib.native 1.7.9.1

AliaksandrZhloba avatar Mar 11 '22 14:03 AliaksandrZhloba

Yes, it can, but from this profile, it looks like a native memory leak. So, unfortunately, you'll have to profile the underlying tdlib, and not the managed part.

(though it's also possible that this memory is reserved by .NET runtime or something; in any case, this doesn't look like a managed memory leak from tdsharp)

ForNeVeR avatar Mar 17 '22 16:03 ForNeVeR

Thanks for the answer. But why do you think about native memory leak first of all? I see that the number of managed objects is increasing.

AliaksandrZhloba avatar Mar 18 '22 09:03 AliaksandrZhloba

On your chart, the amount of unmanaged memory raises, while the amount of managed memory looks constant.

If you believe any managed objects are leaking, then the snapshot analysis should help.

ForNeVeR avatar Mar 19 '22 08:03 ForNeVeR

The amount of managed memory also raises (4.48 ->4.78 MB).

AliaksandrZhloba avatar Mar 19 '22 19:03 AliaksandrZhloba

Unfortunately, I cannot reproduce your results on 1.8.1.

Have you been able to analyze the snapshots?

ForNeVeR avatar Apr 23 '22 09:04 ForNeVeR

No answer for several months; I consider this resolved. If you still have a problem, feel free to drop a comment.

ForNeVeR avatar Aug 28 '22 16:08 ForNeVeR