From owner-freebsd-questions@FreeBSD.ORG Mon Jun 8 20:09:09 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F9B0660 for ; Mon, 8 Jun 2015 20:09:09 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bs1.fjl.org.uk", Issuer "bs1.fjl.org.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F11A14D0 for ; Mon, 8 Jun 2015 20:09:08 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from [192.168.1.35] (mux.fjl.org.uk [62.3.120.246]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id t58K8s3T001124 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO) for ; Mon, 8 Jun 2015 21:09:01 +0100 (BST) (envelope-from frank2@fjl.co.uk) Message-ID: <5575F657.1040301@fjl.co.uk> Date: Mon, 08 Jun 2015 21:08:55 +0100 From: Frank Leonhardt User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: Swap exhaustion References: <1CD13C1C-5344-4909-A061-F25FBB86AFF9@lafn.org> In-Reply-To: <1CD13C1C-5344-4909-A061-F25FBB86AFF9@lafn.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Mon, 08 Jun 2015 20:09:09 -0000 On 28/05/2015 00:49, 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. > > 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? > > > Been there and done that :-) While this doesn't directly answer you're question, I wrote some stuff up about it here: http://blog.frankleonhardt.com/2011/large-swap-files-on-freebsd-die-with-mystery-killed-howto-add-lots-of-swap-space/ It was a while ago,and I'm a bit hazy, but I remember debugged the issue by modifying the kernel files I mention in order to tell me what was going on. It's actually very easy to do. Regards, Frank.