From owner-freebsd-ports@FreeBSD.ORG Tue Jan 3 17:12:04 2012 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50AC71065673 for ; Tue, 3 Jan 2012 17:12:04 +0000 (UTC) (envelope-from geo.liaskos@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 101728FC14 for ; Tue, 3 Jan 2012 17:12:03 +0000 (UTC) Received: by qabg14 with SMTP id g14so12800203qab.13 for ; Tue, 03 Jan 2012 09:12:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iYwrlBYmm78QqPlDk16Udj9wAbPsU7uSL1CXG4s6WGI=; b=FmnQoC+NVGEdAFauBtdR3yOeW+I4FoRpgEzNXWbYCTAeeCvNqv8C59+0Vke1rKBWDB a4yPL/djQncNW8ZefA6MFHVH97LfS2lapsIONXjJiKRW8k6oRMnUOKs7kZvYZ2zkO9Dr L6r+kdBF5FT4UAzK5LhM7SPVJ5JsrBgvS2XoY= MIME-Version: 1.0 Received: by 10.224.220.14 with SMTP id hw14mr62160876qab.42.1325609399179; Tue, 03 Jan 2012 08:49:59 -0800 (PST) Received: by 10.224.208.195 with HTTP; Tue, 3 Jan 2012 08:49:59 -0800 (PST) In-Reply-To: <4F0303DE.5030101@gmail.com> References: <4F0303DE.5030101@gmail.com> Date: Tue, 3 Jan 2012 18:49:59 +0200 Message-ID: From: George Liaskos To: Kaya Saman Content-Type: text/plain; charset=UTF-8 Cc: ports@freebsd.org Subject: Re: Java Heap Space out of memory error Tomcat6 port X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 17:12:04 -0000 On Tue, Jan 3, 2012 at 3:34 PM, Kaya Saman wrote: > Hi, > > I'm running FreeBSD 8.2 x64 edition with 4GB RAM on a quad core machine. > > > I keep 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 > > > and essentially due to it my webapp will simply die and not work - which is > actually xwiki. > > > In order to rectify the situation with the help of some Google'ing I added > this to my Catalina.sh file: > > > > JAVA_OPTS=-Xmx1024m > JAVA_OPTS=-Xms1024m > #JAVA_OPTS=-XX:PermSize=64M > #JAVA_OPTS=-XX:MaxPermSize=256m > > > However, as I found out early this morning, it didn't work I had the same > issue. > > > I have asked on the xwiki mailing list for any advice but it seems the guys > there are all Linux users and can't really help me out much although they > suggested to use: > > CATALINA_OPTS instead of JAVA_OPTS. > > > I have tried that and although it's still too early to tell what is going on > since the last restart was only a few hours ago but I thought I'd just > quickly ask here and see what could be done as CATALINA_OPTS and JAVA_OPTS > seem to be more or less the same with JAVA_OPTS also being used at Tomcat > stop as well as start. > > The odd thing is that I have tested the same webapp and DB combo on a > PowerMac G4 running PPC edition of Fedora 11 which on a 733MHz machine with > 384MB RAM did work fine for over a week if not a little slow. > > I also tested on Nexenta Core 3 (OpenSolaris) running Glassfishv3 on a VM > inside my notebook with 2GB dedicated RAM and that was up for several months > even though really slow again - a while back. > > > Can anyone help me with figuring this out?? > > > I mean I'm not even using swap space on my machine so it definitely has not > run out of memory. It seems a Java option somewhere but I have no idea where > or what. > > > Thanks, > > > Kaya Hello, Try to set tomcat6_java_opts in your rc.conf, the rc script lists the available configuration options. I have the following in my home server: tomcat55_java_opts="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1536m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"