I have an application which uses paho mqtt library. I noticed with VisualVM that there seems to be a memory leak in my application.
First of all I don't understant why there are some peak like that, if someone can explain me this I would be grateful. Then you can see that at the beginning the apps starts with around 5Mb memory and finish with more than 10Mb, I concluded there is a memory leak somewhere, am I right ?
Here is a screenshot after I performed a garbace collector :
You can see that it returns to around 5Mb memory but still grows time after time.
I don't know if this would be useful but I took a screenshot to know from which thread this memory growth come from :
I hope someone will be able to help me. Thanks a lot !
The graph looks like the output of a generational garage collector, and does not show a memory leak. The saw tooth is the young generation working and the increase in the base line is long lived data being copied to the old generation.
The fact the graph resets to 5mb after a triggered collection is the old generation being cleaned up and freeing the now unreferenced data that was copied over from the young generation.