OPENFIRE Server - Memory exceeded


I have Computer Desktop Installed latest version of Openfire running on Centos 5.4

it has 100GB of HDD Intel Board Itel Core 2Duo and 4GB of DDR2 Memory

In One month I always experienced memory exceeded to the Application of OPENFIRE

I allocated the memory from vmoptions like this

vmoptions_val="-Xms512m -Xmx2512m"

Once this it happened the OPENFIRE will not functioned properly all clients connected to OPENFIRE SERVER are disconnected

due to memory execeeded so what will I did is to restart the OS level.

My question how can i prevent this is my memory is not enough?

Right now I have more than 100 user account that everyday sign in and communicate to each other.

Please advice how to improve.