I would like to know details about how the garbage collector works.
I have this function
void foo(){
int dummy[];
for(int i=0; i<10000; i++){
dummy.append(new XmlMessage(engine.getDataPath() + XML_FILENAME));
}
}
According to the definition of the garbage collector, the objects inside dummy should be deleted by the GC, but instead, the program is running bigger and bigger in memory. Is strictly necessary to call delete on those objects in order to get the GC disposing them? What would happen if I create several objects in a thread and that thread dies later on? Is that memory garbage collected?
Thanks!