I think this is where the memory leak is.

Maybe destroying the listeners will help.
set socket to null to garbage collect

this SHOULD fix the memory leak, i used ‘weak’ to verify that this
would in fact garbage collect.