Hi, I’ve noticed a dip in performance as time goes on in my game and decided to boot up JConsole and MAT (eclipse memory analyzer). To my surprise and from what I can see (I’m not very informed when it comes to memory), none of my classes seemed to be the suspect in leaking memory; the culprit was LibGDX’s ShaderProgram.
I’m not sure if I’m suppose to interact with the class, but so far in my code I have not referenced it. I did a quick google search if there have been any problems with it- nothing showed up. I went deeper and checked out what references ShaderProgram to see if I’m referencing it indirectly, and I found that SpriteBatches have a method to create a default ShaderProgram. But I don’t call it.
Here’s what MAT spit out for its suspect:
Here’s the dominator tree:
I still have the heap up in MAT if you have further inquiries.
TL;DR LibGDX’s ShaderProgram class is leaking memory (one time it got up to 1.5GB)