From owner-freebsd-questions@FreeBSD.ORG Mon Nov 25 22:08:29 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A0DD811 for ; Mon, 25 Nov 2013 22:08:29 +0000 (UTC) Received: from mail-ve0-x234.google.com (mail-ve0-x234.google.com [IPv6:2607:f8b0:400c:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3C722D2E for ; Mon, 25 Nov 2013 22:08:28 +0000 (UTC) Received: by mail-ve0-f180.google.com with SMTP id jz11so3280432veb.25 for ; Mon, 25 Nov 2013 14:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=tqH+BxbZsai7eSlSGlC7SuNHEb2UKbijUy2qZwOJBSg=; b=PxeEAcL/QJVkRcDgDwQ5V8mUCT8fkMklFNwXsgtIueZFN7slU866MfHsUrxTZp3KDR HBI7hrjAui9Pb7tQSeyAV14c7ziyOs0wE94V1u9BTX+464ILG17l0tlVt7wUrMG4KF4W YVmfUnQry7w6U5WYoldyWLPJLoFn8UsFntViPcUf1f0mGVfKpmvKleBFNgO0lt1YnMhT yXZKmZjzFoljnVyT25CPHDQiufG5jdk5GCJJfDDBUbGtD2poVrIU7bdKUYnLStaPW67a OQeWV6/NMNQkEm5KIk/aTA1Kuy+gR8kN1cCTjoELyfmEBsVcKmyuwNpqVuH0R09gLxrI c5uw== X-Received: by 10.52.52.137 with SMTP id t9mr10902242vdo.22.1385417307585; Mon, 25 Nov 2013 14:08:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.231.167 with HTTP; Mon, 25 Nov 2013 14:08:07 -0800 (PST) In-Reply-To: <5293C7F7.6040503@d2ux.org> References: <5293C7F7.6040503@d2ux.org> From: Anton Sayetsky Date: Tue, 26 Nov 2013 00:08:07 +0200 Message-ID: Subject: Re: FreeBSD9.2: Tomcat process with very high memory allocation To: Uwe Heber , FreeBSD Questions Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2013 22:08:29 -0000 2013/11/25 Uwe Heber : > Hello FreeBSD team, > > we are hosting a Java web application on our FreeBSD 9.2 server on which > Tomcat 7.0 is used as runtime environment. > > During monitoring the Java process we have found out the Java process > allocates 9GB of memory: > > 39819 www 35 20 0 9051M 439M uwait 4 0:31 0.00% jsvc > > www 39819 0.0 1.4 9268296 449704 ?? IJ 4:05PM 0:30.60 > /usr/local/bin/jsvc -java-home /usr/local/openjdk6 -server -user www > -pidfile /var/run/tomcat7.pid -wait 30 -out > > For this reason, we have reconfigured the Tomcat by setting up the > minimum and maximum heap size in file /usr/local//bin/setenv.sh > with following values: > > > CATALINA_OPTS="$CATALINA_OPTS -Xms128m" > CATALINA_OPTS="$CATALINA_OPTS -Xmx512m" > > After the Tomcat reboot the allocation remains at this very high > consumption. > > Our question at this point: > [1] Is this problem already known? > [2] What are possible options regarding the setup which could solve the > problem? > > If you need further information, please do not hesitate to contact us. > > Thanks for your support. There is _no_ problem. Tomcat has 9 GiB of virtual memory and 439 MiB of resident. The actual amount of really used mem is 439 MiB. Virtual contains all memory that theoretically can be used (but NOT allocated at a point of time in contrast of res) by process, all shared libraries that it used etc etc. In practice, virt memory shows nothing helpful. You should take a look on only resident memory of processes in most cases. http://linuxpoison.blogspot.com/2009/10/what-is-difference-among-virt-res-and.html