Too many elements in the user roster.. Warning

Hamid Alimohammadi
Added almost 4 years ago


Could you please help to find what may cause a repetitive Warning that I get in tigase-console.log file?

The Tigase test server's version is "7.0.0-SNAPSHOT-b3699" and the following Warning in console.log file occurs 315 times:

2015-04-13 16:12:52.462 [presence Queue Worker 3] Presence.process() WARNING: Error accessing database for presence data: {0}

tigase.db.TigaseDBException: Too many elements in the user roster.

    at tigase.xmpp.impl.roster.RosterFlat.addBuddy(

    at tigase.xmpp.impl.Presence.processOutSubscribe(

    at tigase.xmpp.impl.Presence.process(

    at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(


The file is:


--vhost-anonymous-enabled = false




























Thank you in advance

Replies (4)


Added by Artur Hefczyc TigaseTeam almost 4 years ago

Apparently user's roster exceeded the maximum allowed size on your installation. The exception is thrown when there is an attempt to add a new contact to a roster when the roster is already at maximum size.

The roster maximum size is a dynamic value which depends on the memory available to the Tigase XMPP Server software. Here is the algorithm we use to calculate the maximum roster size:

private static int maxRosterSize = new Long(Runtime.getRuntime().maxMemory() / 250000L).intValue();

A solution to you would be to calculate the maximum size on your installation and ensure that you really require rosters with a bigger size. (maybe it is kind of a DOS attack on your service?)

If you really require large rosters on your system then you can increase amount of memory available to the Tigase server on your installation.

Added by Hamid Alimohammadi almost 4 years ago

Thank you Artur for the reply.

After reading your comment, I adjusted the memory in tigase.conf and the Warnings disappeared.

I used the following Linux command to get Heap memory parameters in the test server:

java -XX:+PrintFlagsFinal -version | grep HeapSize

I looked for the options MaxHeapSize (for -Xmx) and InitialHeapSize for -Xms

Added by Igor Khomenko about 3 years ago

Artur, is it possible to limit the max size of roster, for example via

I just run the following code on my local machine with 8GB RAM onboard:

int maxRosterSize         = new Long(Runtime.getRuntime().maxMemory() /250000L).intValue();
System.out.println("maxRosterSize: " + maxRosterSize);

and got 7635.

It's too big for one user and potentially a possible vulnerability for the server.

I see the following problems:

1) It will be hard to serialise/deserialize such a big roster for server

2) load for DB.

3) it's hard for client to load such a big roster - traffic issue

would be great to have a possibility to limit it via config. For example set it to 100 or something like that

Added by Wojciech Kapcia TigaseTeam about 3 years ago

Thank you for suggestion - I've created #3849 and added you as a watcher.