In a nutshell, there is a
thread that can stop all other thread that will wipe not used objects to free the memory. This is rough speaking, as Joanne said, there are much more content about in this forum and in internet (would not be nice to repeat everytime, better we stand over the shoulders of who already made a good post here our a blog, for example)