That means the problem is most likely not the actual allocated heap size (Xms/Xmx), but rather another memory area. The most common culprit is the MaxPermSize. If your application is big enough, when its classes are all loaded into the Perm area on startup, it may not all fit. It may also gradually tip over the the Perm area size as reflection is used, and the reflected elements are added to the Perm area. Just try increasing the allocated Perm Size and see what happens, or if you are actually methodical and trying to get a solution that lasts, try using JVMstat to check your memory usage.
That means the problem is most likely not the actual allocated heap size (Xms/Xmx), but rather another memory area. The most common culprit is the MaxPermSize. If your application is big enough, when its classes are all loaded into the Perm area on startup, it may not all fit. It may also gradually tip over the the Perm area size as reflection is used, and the reflected elements are added to the Perm area. Just try increasing the allocated Perm Size and see what happens, or if you are actually methodical and trying to get a solution that lasts, try using JVMstat to check your memory usage.
In essence tune your JVM more.