GlobalQuake icon indicating copy to clipboard operation
GlobalQuake copied to clipboard

Fix memory leak in object streams by reusing the same packet instance

Open PopSlime opened this issue 2 months ago • 0 comments

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 ObjectInputStreams and ObjectOutputStreams track all instances involved in them, this can improve memory usage of the application.

PopSlime avatar Apr 26 '24 07:04 PopSlime