From owner-freebsd-questions@FreeBSD.ORG Tue Nov 26 10:56:32 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3154D14A for ; Tue, 26 Nov 2013 10:56:32 +0000 (UTC) Received: from mail-vb0-x232.google.com (mail-vb0-x232.google.com [IPv6:2607:f8b0:400c:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E936F242F for ; Tue, 26 Nov 2013 10:56:31 +0000 (UTC) Received: by mail-vb0-f50.google.com with SMTP id 10so3667822vbe.23 for ; Tue, 26 Nov 2013 02:56:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FQTFjrO3Otfy0AcZUAiwUjpbVv/CC0Dm/ID6kmbRZ98=; b=uiSzrB4V6L16xxHxyNQkAVzZXwyr2kOkwI07QfM8jLbYKdI8NHLIZks2kCysyeo4Px 6Trb9uLA6beeFb3g4Txcju4/dGvhl7InyBy1Bpkzya8VIOnGdEpTt57p9P7wSqklHCS2 4rZko163ME3rSIGDpWzO3JTCqn9TU/kPBYwUOqxFEcpNbAnqhx8rI2PwzFPRJrxJFE5c IXZ+jZd3Z3G7t13DN2HOnSGPycNFTj0iSz4kwpJ30VR3ovDKIRpjboSTw2wXWPwQkvmh Iv8c/ueIR7Bye6acj9GvyLgbRsXA3Gnv6Cuuy7Gve9KlsTbjDmUHZ7xY7//ugLAaeahm CQgg== MIME-Version: 1.0 X-Received: by 10.58.67.168 with SMTP id o8mr6454207vet.22.1385463390575; Tue, 26 Nov 2013 02:56:30 -0800 (PST) Received: by 10.58.231.167 with HTTP; Tue, 26 Nov 2013 02:56:30 -0800 (PST) In-Reply-To: <5293EB36.9000303@petermann-it.de> References: <5293C7F7.6040503@d2ux.org> <5293EB36.9000303@petermann-it.de> Date: Tue, 26 Nov 2013 12:56:30 +0200 Message-ID: Subject: Re: FreeBSD9.2: Tomcat process with very high memory allocation From: Anton Sayetsky To: Matthias Petermann Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Questions 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: Tue, 26 Nov 2013 10:56:32 -0000 The best way to know this is looking at the top source code. :) But even this will not show you what amount of memory process can eat because it can call malloc() at any time and get more memory. Of course, you can: 1. Use integrated limits similar to that in PHP, Java, if application supports them. 2. Calculate maximum memory usage if footprint is known. For example, lzma-based archiver will allocate about 11*dictionary_size memory for compression in worst case. 3. Set system limit in login.conf. The second is preferred. If this impossible, you can use first (but this can have negative effects). Third is the worst way - it can crash the application. App says: "Kernel, give me two additional megabytes of memory", and kernel will respond: "I don't have any free memory" even if the actual free memory amount is very large 2013/11/26, Matthias Petermann : > Hello Anton, > > On 11/25/2013 11:08 PM, Anton Sayetsky wrote: > >> 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 > > Just for curiosity - is there a way to display all (theoretically) used > virtual memory of a process? So I'd like to understand how it calculates > the total size shown in top. > > Many thanks in advance. > > Best regards, > Matthias > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" >