I switched to Smack 3.1.0, but in my tests – where I’m simulating 2000 users logging in and connecting to rooms in an ejabberd server – the test is using up all available memory.
I have verified that the memory is all being used my Smack classes (as before), even though I am now making sure to drain the packet queue (through polling until empty) at each packet reception. Before I did that, I was running out of memory far more quickly.
Now, I create and log in 2000 users, then have all of the users join one or more rooms, slowly over time (so as not to overload the server).
When I get to around 800 or 900 users attempting to connect to rooms, my test app (again, mostly within the Smack library) use up around 3.5gb of memory. If I only connect/login 1000 users, then they all can join rooms without using up quite as much memory. It seems the existence of 2000 connected users pushes memory use higher even if not all of them have joined rooms. Basically, logging the users starts building memory use, and then users joining rooms uses up even more.
Also, when I watch over time, even when the numebr of users is smaller, memory use slowly grows over time… it appears to be some kind of leak. I have run profiling tools on my code, and all the memory seems to be being created in Smack.
Smack developers: I ask you, what could possibly be using up all that memory within the Smack library? Do you believe that 2000 concurrent connected/logged-in users, all joining rooms, etc., should create such a huge use of memory?
I admit, there is always the possibility I am using the API incorrectly somewhere; but it appears that the memory’s being used up by the Smack API itself, and its internal workings.
Have you ever tried this kind of thing with your code?
San Francisco, CAUSA