Dreaded topic... garbage collection

i have an application that checks an updated XML every 5 seconds. i declare a new XML object within the function and delete it at the end of the function. Some of the XML attributes are saved, but, most of the XML data are ignored if there’s no update. There are 4 different main XML childs that I look into to decide whether to ignore it or not.

I do however assign the length of those four childs to a variable and the part that flags if there’s an update into an array. Values from that array is then assigned to global variables to be used by other functions.

Would any of these be considered a reference and keep the XML to resign in the memory? I have a feeling that it does since memory usage on the app goes up every 5 seconds even if there is no update.

is there a way to just grab a value of the object without having to reference it?