From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Re: Debugging emacs memory management Date: Wed, 16 Sep 2015 10:34:58 -0600 Organization: XCP-1 Message-ID: <55F99A32.3000505@lanl.gov> References: <87zj8l3r32.fsf@secretsauce.net> <87vbbbxz2e.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1442421350 16796 80.91.229.3 (16 Sep 2015 16:35:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Sep 2015 16:35:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dima Kogan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 16 18:35:41 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZcFgH-0004DV-U5 for ged-emacs-devel@m.gmane.org; Wed, 16 Sep 2015 18:35:38 +0200 Original-Received: from localhost ([::1]:51938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcFgC-0003St-4i for ged-emacs-devel@m.gmane.org; Wed, 16 Sep 2015 12:35:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcFft-0003Qw-OD for emacs-devel@gnu.org; Wed, 16 Sep 2015 12:35:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcFfo-0000JR-PS for emacs-devel@gnu.org; Wed, 16 Sep 2015 12:35:13 -0400 Original-Received: from proofpoint5.lanl.gov ([2001:400:4210:400::a5]:57865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcFfo-0008V3-H0 for emacs-devel@gnu.org; Wed, 16 Sep 2015 12:35:08 -0400 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by mailgate5.lanl.gov (8.15.0.59/8.15.0.59) with ESMTP id t8GGYwwu007591; Wed, 16 Sep 2015 10:34:58 -0600 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay1.lanl.gov (Postfix) with ESMTP id E56AA139899C; Wed, 16 Sep 2015 10:34:58 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay1.lanl.gov Original-Received: from xray-r08.lanl.gov (xray-r08.lanl.gov [128.165.123.189]) by mailrelay1.lanl.gov (Postfix) with ESMTP id D5A53139898C; Wed, 16 Sep 2015 10:34:58 -0600 (MDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110717 Lanikai/3.1.11 In-Reply-To: <87vbbbxz2e.fsf@secretsauce.net> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151, 1.0.33, 0.0.0000 definitions=2015-09-16_04:2015-09-16, 2015-09-16, 1970-01-01 signatures=0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:400:4210:400::a5 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:190025 Archived-At: > Another observation is that the gc never really gives back the memory. > [...] > So the memory IS freed, but emacs never gives it back to the OS. The Emacs GC can relocate some things (e.g., strings) to help make memory available all the way back to the OS, but -- at least for many small allocations -- it is typical that memory freed within a process never makes it back to the OS. The "small allocations" is because modern malloc(3)s use mmap(2) to obtain large blocks of memory and those are returned to the OS immediately upon free(3). Otherwise the best you can hope for is for some of Emacs' pages to be dropped to swap, where (if that memory is never used again by Emacs) they will languish until Emacs exits. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.