We ported our application to a dedicated server and 50% of the physical RAM is allocated to the application. The RAM on the server is 2GB and the application uses 1MB using -Xmx1024M.
However, after some time <12hrs , the memory usage goes to 900MB and stabilizes there for a while and eventually bails out giving java - outofheap error. If the memory is not set using Xmx, it takes 256MB after 2 days. When I allot 1024M, it takes far less time to eat 900MB. I think there is lot of garbage collection going on and this seems to be a problem.
Could someone tell me the appropriate settings for the app to make sure that it does not eat up all the RAM?