I am currently experiencing a memory leak in my code, and I have a gut feeling it's because of the multiple times I'm getting instance of a class without actually closing it, causing many many instances of the class. So my question is, is there any way I can close the instance of the class I'm getting? I'm getting the instance like such: public static MyClass getInstance() { return new MyClass(); }
And then I'll get instance of the class by doing: MyClass instance = MyClass.getInstance();
So I suppose what I'm asking for is if there is something like a .close(); method to close my instance.
Thanks.