Garbage Collection: Are instances of a class freed when a new instance is a assigned to the same variable name?
in
Programming Questions
•
2 years ago
Hello,
I am new to processing and wrote some code that instantiates a class (class A) that in turn instantiates an array of another type of class (class B). This occurs on every instance of void draw, so I wanted to make sure I didn't have a memory leak, my first instinct would be to say that since a new version of class A is being instantiated there should be no pointer to the old version (since they are under the same name), since the class B array is an inner class of A I would think that A would be garbage collected, getting rid of the class array and then freeing any B objects, but I wanted to be sure, is this correct? Also is there a heap profiler for processing?
1