PetaPoco icon indicating copy to clipboard operation
PetaPoco copied to clipboard

Memory leak for mysql

Open thenik opened this issue 1 year ago • 4 comments

Hi,

Memory leak detected for mysql data via PetaPoco during intensive usage :

image

Any ideas how to adjust it?

thenik avatar Aug 19 '24 13:08 thenik

@thenik It's not clear to me what that image is showing. Can you please describe what you think is being leaked, and provide a minimal repro?

asherber avatar Aug 19 '24 13:08 asherber

@asherber . Thanks for your question.

This images shows 1 of many reteined objects for my app during 1h of usage. For this image it is RuntimeMethodHandle . About 26K RuntimeMethodHandle objects retained for my app during 1h . image

I used dotMemory for analysis and as you see this RuntimeMethodHandle object came from PocoData. I do not have an independent code sample that will reproduce that now.

thenik avatar Aug 19 '24 13:08 thenik

If I had to guess, I'd say that this is something being kept in PocoData's cache rather than something being leaked. Are you running queries with thousands of different types?

Without some sort of minimal repro, this will be hard to diagnose.

asherber avatar Aug 19 '24 14:08 asherber

@asherber Yes, you are right that I found something interesting with PocoData's cache. I call it memory leak =) I call it memory leak because when I look at my app via TaskManager it could consume up to 2gb RAM if it works more than 1 month and it came from PocoData's cache as I know now.

Are you running queries with thousands of different types?

no =) I use for this case just 6 types, I marked them on the next image:

image

to be honest I tried to create a demo c# app that will reproduce that, but still without success 1st version was 1 thread version with 1 type 2nd - multithread with 1 type 3d - multithread with 2 types

and there is no my "memory leak" I do not have idea how to implement an app that will reproduce that now.

if any ideas what I can implement for demo app to reproduce or where to look - welcome. Thanks

thenik avatar Aug 19 '24 19:08 thenik