On 01/03/2012 12:13 AM, Kaya Saman wrote:
  Hi,
 first up Happy New Year to everyone :-)
 Secondly, I've been trying to stabilize my Xwiki install on FreeBSD
 8.2
 x64. My machine is a quad core box with 4GB RAM and not much usage in
 terms of people viewing the wiki etc....
 I am getting this error:
 umbers=0&rev=11.1" java.lang.OutOfMemoryError: Java heap space
 Exception in thread "http-8180-Acceptor-0" java.lang.OutOfMemoryError:
 Java heap space
 I have attempted a resolution by including: - after Google'ing heavily
 to see what could be done to rectify the issue.
 JAVA_OPTS=-Xmx1024m
 JAVA_OPTS=-Xms1024m
 #JAVA_OPTS=-XX:PermSize=64M
 #JAVA_OPTS=-XX:MaxPermSize=256m
 at the top of the catalina.sh file but as I've just found out it
 didn't
 work.
 The strange thing is that I had this wiki migrated to an old
 PowerMac G4
 733MHz with 384MB RAM and even though the cpu went up to max due to
 the
 amount of swap space consumed the system still worked fine for longer
 then my BSD machine at least.
 Can anyone give me a hand in order to diagnose the problem?
 I have tried this also on Nexenta Core 3 (OpenSolaris) on a virtual
 machine running on my notebook with 2GB RAM dedicated to it which
 worked
 fine also and was up for many weeks even though pathetically slow.....
 actually I was running Glassfishv3 but it was still Java!
 Thanks, 
 Indeed, the proper fix is to increase the amount of memory that the
 JVM can use, and it should be done with the -Xmx1024m parameter as you
 tried. And that value should be enough. Seeing that it doesn't work,
 then catalina.sh must somehow discard that JAVA_OPTS variable along
 the way. To test it, just do a ps or top after Tomcat is started to
 see exactly what command line is being executed; does it have your Xmx
 setting or not?
 Anyway, I don't know how FreeBSD packages Tomcat, but normally you
 shouldn't edit catalina.sh directly, there should be a dedicated
 configuration file where you can specify parameters. On my Gentoo it's
 in /etc/conf.d/tomcat-6. And the recommended variable to set is
 CATALINA_OPTS, not JAVA_OPTS, and catalina.sh should append whatever
 you set in CATALINA_OPTS to the final JAVA_OPTS that it computes and
 which gets passed to the java command. 
 Thanks for that!
 I've just changed the option to CATALINA_OPTS from JAVA_OPTS and see if
 that works....
 running ps aux gave me this output but nothing substantial: