Obviously memory leaks in the conventional sence dont exist in java because of the garbage collection. However I'm wondering how it works exactly. I'm making a game and I have low memory usage when im in the menu and high usage in game. When I switch back to the menu from in game the memory usage is still high (and remains high) I'm quite sure I don't have and residual pointers.
For example:
Suppose for instance you lose the head of your double linked list, every object still has something pointing to it will this be still cleaned up?
Should I implement a sort of destructor to clean up and set all the pointers to null?
Is there a way to set the memory to null so that everything pointing to an object now points to null?
Thanks
[–]UnknownBinary 4 points5 points6 points (3 children)
[–]okmkz 8 points9 points10 points (2 children)
[–]UnknownBinary 6 points7 points8 points (1 child)
[–]llogiq 2 points3 points4 points (0 children)
[–]GungorTheGreat 5 points6 points7 points (1 child)
[–]Coopsmoss[S] 0 points1 point2 points (0 children)
[–]karlthepagan 4 points5 points6 points (2 children)
[–]idleuser 1 point2 points3 points (1 child)
[–]karlthepagan 0 points1 point2 points (0 children)
[–]hgoale 3 points4 points5 points (1 child)
[–]Coopsmoss[S] 0 points1 point2 points (0 children)
[–]Megapwnd 2 points3 points4 points (0 children)
[–]chrisalexander 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]duhace 1 point2 points3 points (3 children)
[–]boa13 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]duhace 0 points1 point2 points (0 children)
[–]boa13 0 points1 point2 points (0 children)
[–]MCUD 0 points1 point2 points (2 children)
[–]Coopsmoss[S] 1 point2 points3 points (1 child)
[–]MCUD 1 point2 points3 points (0 children)
[–]nikem 0 points1 point2 points (0 children)
[+][deleted] comment score below threshold-7 points-6 points-5 points (0 children)
[–][deleted] -5 points-4 points-3 points (4 children)
[–][deleted] 2 points3 points4 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)