optimized chesco socket memory management a bit