From owner-freebsd-questions@FreeBSD.ORG Thu May 28 05:09:15 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46D227B for ; Thu, 28 May 2015 05:09:15 +0000 (UTC) (envelope-from bc979@lafn.org) Received: from zoom.lafn.org (zoom.lafn.org [108.92.93.123]) by mx1.freebsd.org (Postfix) with ESMTP id 22208796 for ; Thu, 28 May 2015 05:09:14 +0000 (UTC) (envelope-from bc979@lafn.org) Received: from [10.0.1.2] (static-71-177-216-148.lsanca.fios.verizon.net [71.177.216.148]) (authenticated bits=0) by zoom.lafn.org (8.14.7/8.14.9) with ESMTP id t4S59AtU088019 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 May 2015 22:09:11 -0700 (PDT) (envelope-from bc979@lafn.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: Swap exhaustion From: Doug Hardie In-Reply-To: <20150528000655.GA15385@neutralgood.org> Date: Wed, 27 May 2015 22:09:10 -0700 Cc: FreeBSD - Content-Transfer-Encoding: quoted-printable Message-Id: <6F843A4D-8D2D-4DE2-B90E-A8033BEC1500@lafn.org> References: <1CD13C1C-5344-4909-A061-F25FBB86AFF9@lafn.org> <20150528000655.GA15385@neutralgood.org> To: kpneal@pobox.com X-Mailer: Apple Mail (2.2098) X-Virus-Scanned: clamav-milter 0.98 at zoom.lafn.org X-Virus-Status: Clean X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2015 05:09:15 -0000 > On 27 May 2015, at 17:06, kpneal@pobox.com wrote: >=20 > On Wed, May 27, 2015 at 04:49:52PM -0700, Doug Hardie wrote: >> I have a process that is eating up 6 GB of swap space. At that = point, FreeBSD 9.3 terminates a process. However, occasionally its not = the one eating up the space. When I manually quit the process then the = swap space returns to a few KB used. The system runs fine after that. >>=20 >> I have very little knowledge of what this process is doing internally = but would like to know what might be causing this issue. There are 5 of = these processes running (parent plus 4 children). Normally each uses = about 90 MB RES/SIZE. However when the problem occurs they are about = 2GB RES/SIZE each. The system has 4 GB memory. I thought that a malloc = would not be able to grab that much memory, even with swapping as it has = to be in memory. Could a malloc cause this growth in process size or = need I look elsewhere? >=20 > There's a difference between "real" memory and "virtual" memory. The > malloc() call allocates _virtual_ memory. So the maximum amount that = can be > malloc'd and used would be the size of your real memory plus the size = of > your swap space. If I am understanding correctly, then it appears that a process can = actually allocate enough memory to eat up the swap space. Then I need = to find out why that process is allocating so much memory. Thanks.