JVM memory overflow

Does too many offline messages affect the server’s operation? When the offline message table is emptied, the server’s memory will be normal.

I have never seen that happen, but yes, I can imagine that in a test scenario, having many offline messages will slow things down considerably (as they are loaded when a user logs in).

Do you have the same problem after you disable the offline message functionality?

After further testing, I seem to have found the cause of memory leak. When the user’s offline message is too large, SAXReader has a memory leak, and GC can’t recover memory!
My Openfire version is 4.2.3, and memory overflows occur when processing 20,000 pieces of data at the same time.
But openfire 4.2.4 handles 20,000 messages, with a maximum memory of 600M, and is a matter of seconds.
Is there a BUG in the version of openfire 4.2.3? I can’t find the repair record for this version.

Are you sure you are using 4.2.4? How did you get it? From GitHub Releases page? From what i know 4.2.4 was an unofficial release for some customer. So there was no official changelog posted. But maybe same fix was also backported to 4.3. So can you try with 4.3.2 and tell if it works better than 4.2.3?

Yes, I downloaded it from GitHub.
If you store offline messages (with database operations), server performance will be greatly reduced. What can I do to improve it?
Because I see that the addMessage method needs to get MessageId (although not every time).
Getting MessageId uses synchronized. Is this the reason for performance degradation?
I would like to ask whether the number of users (not online users) has an impact on server memory, because of UserCache?
Finally, thank you very much, as well as Guus’s answer, so I learned a lot.

So you have a problem with 4.2.3 and 4.3.2, but not with 4.2.4? That is very weird, as 4.3.2 should have the same changes as 4.2.4!

Can you share the code and setup to reproduce this problem? I’d like to try it on my own environment.

I’m sorry, because there are some problems I can’t share.
I’ve found the problem.Because there are database operations when messages are sent,When I removed these , everything was all right.Possible offline messages need to be optimized,
Finally, thank you again for your support and help!

1 Like