Thanks for the in-depth explanation, and you're totally right ;)Quote:
Actually you can't garbage collect code (I know you didn't mean that but you said it in a confusing way). Your code is executed. It might get some references to class instances and the reference counter for that instance is increased. Once you leave the scope where you acquired that reference to the instance the reference counter will be decreased again. If the reference counter is 0 the object will be garbage collected on the next run of the gc. But most of the time those objects (Map, Session for example) are kept alive somewhere in a List/Dictionary in one of the managers so there will be nothing which gets collected after a function. Just at disconnects garbage collection will actually be effective. But yes creating a new MovementManager like cryz does is slower than yours. Just wanted to correct the gc part.