This Question is Answered

10 Replies Last post: Apr 6, 2008 9:52 PM by BenV  
BenV Bronze 65 posts since
Jan 25, 2007
Currently Being Moderated

Jan 14, 2008 11:43 AM

Potential MUC Memory Leak?

I believe that MultiUserChatServerImpl contains a small memory leak if the MUC idle timeout is set to -1 (disabled).

 

 

 

 

It appears that the only time removeUser() is called is from the UserTimeoutTask, which is not run if that option is disabled. This means that over time if you are generating lots of new user accounts like we are, and have heavy usage of MUC, you will run out of memory since the 'users' map in MultiUserChatServerImpl will grow infinitely.

 

 

 

I was able to fix this by modifying the source code to make removeUser() public and calling it manually when a user goes offline, but this is obviously a poor solution. Maybe a better one would be to have the user cleanup task always run and remove users who are not in any rooms regardless of the value of the 'xmpp.muc.tasks.user.timeout' property.

 

 

 

Any thoughts on this?

Gaston Dombiak Jiver 3,751 posts since
Sep 26, 2001
Currently Being Moderated
Jan 16, 2008 2:27 AM in response to: BenV
Re: Potential MUC Memory Leak?

Hey BenV,

 

I like your last proposal. If you can implement it and send us the patch then we will gladly review it and incorporate it.

 

Thanks,

 

  -- Gato

Gaston Dombiak Jiver 3,751 posts since
Sep 26, 2001
Currently Being Moderated
Jan 21, 2008 11:37 AM in response to: BenV
Re: Potential MUC Memory Leak?

Hey BenV,

 

This issue was filed as JM-1251 and your fixed was checked in for Openfire 3.5.0.

 

Thanks,

 

  -- Gato

Guus der Kinderen KeyContributor 377 posts since
Sep 8, 2005
Currently Being Moderated
Mar 27, 2008 8:58 AM in response to: BenV
Re: Potential MUC Memory Leak?

The implemented patch fixes but a part of the problem. See JM-1312

Gaston Dombiak Jiver 3,751 posts since
Sep 26, 2001
Currently Being Moderated
Mar 27, 2008 5:08 PM in response to: Guus der Kinderen
Re: Potential MUC Memory Leak?

Hey Guus,

 

Thanks for catching that one. Your suggested solution was correct. The fix was applied to Openfire 3.5.0 RC2 to be released later today.

 

Regards,

 

  -- Gato

More Like This

  • Retrieving data ...