I came across this in a high load scenario (~40k users). I have setup Openfire in a S2S configuration. The local server is setup with adequate heap size and normally (when both servers are up) handles the load perfectly well. The remote server goes down (due to firewall, network issues, maintenance, etc.) for an extended time (10 hours). The error reported in the logs indicates ‘Error trying to connect to remote server’. After this time the local server throws an OutOfMemoryException.
Analyzing the generated core/heapdumps indicates a very high number of accumulated objects within the OutgoingSessionPromise instance. In particular they are Packet objects added to the packetQueue (ConcurrentLinkedQueue). I modified the implementation of
returnErrorToSender() (http://fisheye.igniterealtime.org/browse/openfire/trunk/src/java/org/jivesoftwar e/openfire/server/OutgoingSessionPromise.java?hb=true) and removed the routes iteration (passing ‘from’ to setTo()) for the Presence error replies. This improved the issue a bit but the memory leak still appears in some cases.
Have you come across this? Is this a known issue? I’ve seen some bugs reported in the same area but they seem to indicate different issues.
Thanks,
Kostas