GlobalQuake
GlobalQuake copied to clipboard
Fix memory leak in object streams by reusing the same packet instance
Description
Instances of HeartbeatPacket
and EarthquakesRequestPacket
are sent periodically during a connection. However, these two record classes carry no additional information, so it is safe to reuse a single instance for each of them. As ObjectInputStream
s and ObjectOutputStream
s track all instances involved in them, this can improve memory usage of the application.