From owner-freebsd-hackers@freebsd.org Wed Sep 14 19:15:27 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30A56BD6CF6 for ; Wed, 14 Sep 2016 19:15:27 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 22E05151F for ; Wed, 14 Sep 2016 19:15:27 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yuri.doctorlan.com (c-24-5-143-190.hsd1.ca.comcast.net [24.5.143.190]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id u8EJFJtR047166 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 14 Sep 2016 12:15:19 -0700 (PDT) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-24-5-143-190.hsd1.ca.comcast.net [24.5.143.190] claimed to be yuri.doctorlan.com To: Freebsd hackers list From: Yuri Subject: System becomes unresponsive when it runs out of memory Message-ID: Date: Wed, 14 Sep 2016 12:15:18 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 19:15:27 -0000 I observed this several times: when the system with 24GB RAM +4GB swap runs out of memory and swap, it loses the ability to be connected to. ssh connects, but the second factor authentication (google-authenticator) fails to produce the code. This lasts for an extended period of time (~15 min), after which ssh connection eventually succeeds. My question is: isn't it supposed to kill the largest process when it runs out of memory? IMO, this is a bug that system doesn't handle memory-full condition well and hangs up like this. Another bothersome thing is that I can't really account for the consumed memory. There are several large processes with sizes ~50GB, but madvise(MADV_FREE) has been called on most of that memory by the perftools malloc library. So I don't understand why this memory-full occurred in the first place. Is it possible that madvise(MADV_FREE) doesn't discard memory? Yuri