High Openfire java memory consumption

Hello, good morning,
I am experiencing high consumption in the Java memory of the messaging application Openfire version 4.8.3. I appreciate your help to know how I can increase or control it so that it does not block the system and stop working clients like Spark.

The data is as follows:

S.O. Win 10 Ver. 22H2
Openfire version 4.8.3
Java™ SE Development kit 18.0.2 (64 bit)
287 users created
25 GB ram memory
200 Gb in storage

Please let me know how to proceed.

Thanks

Translated with DeepL.com (free version)

Java memory reporting is not a simple thing. A 89% usage does not necessarily mean that something is wrong or leaking memory with the system. Are you actually seeing memory related errors logged or other failures due to memory exhaustion?

The problem occurs when the java memory reaches 100% usage, the system collapses and all Spark clients are offline, the server takes a long time to start the service and I don’t know how to increase the memory or what is the reason for the increase in its usage.

What does openfire log when it collapses? Increasing the memory is found in a number of forum posts here. You likely need to take heap dumps and see what’s using all the memory.

When it crashes it simply does not enter the openfire panel, the Spark client users remain in a state of reconnected to the server. I have also seen several pages where they indicate how to increase the memory but I have the doubt if it applies to all versions of openfire since I have the 4.8.3 and is to establish a minimum of 512M and a maximum of 1024M,

-Xms 512m
-Xmx1024m

the memory is getting closer and closer to 100% usage.

Would it be possible for you to create a memory (hprof) dump of the server when it crashes (or at a point where the memory is so full that it almost crashes)? This could be analyzed to find the source for this problem.