How to fix Memory Leaks?

I noticed my drawing software starts to very slowly fill up the ram. How can i detect unused objects and where does it come from? Can it be when increating variables? I mean if i let the software just chill and not even draw, it is increasing too. What could be the error?

It seems to be a visual bug when i calculate the ram usage for some reason…
nope it definitly isnt a bug!!!

How are you determining the actual memory used? Most tools do not show this. Instead they will show how much has been allocated, even if it is not in use.

(Not a topic I am expert at, but I recall this warning from software testing.)