[UDP] Improve memory usage