Openfire java huge memory usage

High memory usage on Linux operating system by openfire. Whot can i do?


Increasing memory for Java does not solve the problem (i mean this -Xms512m -Xmx1024m)
Please help me!

The best way to analyze memory usage is to create a Java heap dump, and analyze that with third-party tooling. This is highly specialistic work. You’ll likely need support from an experienced Java developer.

From experience, memory leaks often originate in custom additions to Openfire. Is your server using custom plugins? If so, try disabling them.

no. everything is standard. then tell me which combination of operating system and openfire is the most stable or how can I fix this situation with the least amount of damage? Currently, we are using Astra Linux (based on Debian 10) with the latest version of Openfire.

The Java is eager to memory, and it’s fine if it uses almost all memory that is allowed to it.

When it will not enough of memory it will just free it with Garbage Collector. The more important is CPU and Disk usage.
Anyway, please ensure that you are using not embedded database (HQSQL) but something like PostgeSQL or at least MySQL. You may also try to disable debug logging, it should help a little bit.

If you know java then you may also try to find performance problems: use VisualVM or JavaMelody.

At least try to make a thread dump and analyze it.

If you are looking for a more lightweight server then you may try the Ejabberd (the most advanced) or more simpler Prosody (can be used on a router). There is also Tigase server also written in Java and they trying to be more fast.

There is no recommended combination. Generally speaking, use the most up-to-date version.

You are referring to ‘damage’. Are you sure that things are, indeed, broken? As others in this thread already mentioned, high memory usage may not indicate a problem at all. It could simply be the JVM optimizing things. When CPU usage doesn’t spike, and no functional problems occur, then you might not be experiencing an actual issue.

If you do suspect that something is wrong, please create a heap dump, as I’ve suggested earlier. That will allow us to dig down into the details and do a proper analysis.

As a result, I put everything from scratch on Ubuntu. At the moment, everything is working stably. Java takes 400-500 megabytes, periodically clearing garbage. Apparently, the problem may have been in the unoptimized operation of the previous OS (Astra Linux) and Java