From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Danny YUE Newsgroups: gmane.emacs.help Subject: Re: Emacs eats up my memory while viewing images Date: Fri, 09 Jun 2017 00:06:49 +0800 Message-ID: <87k24mh3ae.fsf@gmail.com> References: <87shjau1x0.fsf@gmail.com> <837f0m8qjp.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1496938211 1874 195.159.176.226 (8 Jun 2017 16:10:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Jun 2017 16:10:11 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.2.1 Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 08 18:09:59 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJ00U-0008KJ-Sw for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Jun 2017 18:09:58 +0200 Original-Received: from localhost ([::1]:50507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJ00Z-0007hC-Tk for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Jun 2017 12:10:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIzzw-0007fm-9F for help-gnu-emacs@gnu.org; Thu, 08 Jun 2017 12:09:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIzzv-00028j-BE for help-gnu-emacs@gnu.org; Thu, 08 Jun 2017 12:09:24 -0400 Original-Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:34838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIzzs-00027A-2X; Thu, 08 Jun 2017 12:09:20 -0400 Original-Received: by mail-pg0-x241.google.com with SMTP id f127so5049326pgc.2; Thu, 08 Jun 2017 09:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=mqoJSElkDQ7k0VpfS9REnr3rK3in7I5W/BL6i1d0BCA=; b=s8kG7O1n2TQUZdt9TG11HmUXaqPty/lETOf7glBkEjtySHk3Q0z6g+nJtergLWAyTW IdZ5xiyMR1LmCt8r5wtxHvolyoUUkWkkR+62EnQzoIMhd+sVrKb0k2yjNA1rWVy05nyc Bk3N3raD6tgsY7rkFrNVe7oQK5ibQC9/yqjnKV4xlhZ8rZWKvEPAPOr0ceyWPsQedR/D DsIDJFXy6pcnUyysgNCFKV1h2f/AEQbqITcuj8rUvcMmT+aGFhyJ3Pz+i/ObdEw3Z0/s ptHisx0ndKuyebUItKPj9FC6cU0iuzwUOJi4I9lullLz261N+yq1+SYezObGUYd967he Md8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=mqoJSElkDQ7k0VpfS9REnr3rK3in7I5W/BL6i1d0BCA=; b=p6LIeXRPTI5KY5JM/u3m5VOV3MYYw0jdy1JSCBDeHoKp8huuSCxJ8sE4KpMKjgo9fB 6bUz528fWrUt8F3I3chkTH28CrxNk2ikT/KiZcKOyiF+LGv5LDyK/ZYvLAFJ8GMOs1Y7 0ETERCeFB/cARPSu56R/HPjnFGqpeeyrTprA5IunvTsgsZGHfKL/1cwHYfG+V28b7FZJ t8PDbZwdp6JVhpnkLJGvUqEy9d7OH6cSKNDMhfA5o31SNVNHKoMT0XE9yF6Kd1LdY6HV Jp0aqQcHcFIPztebKWzt6/Rnj5w/hXy6+rXyg/6bbQrBDPChp9aHACCl5q+Cz2DWHuRL 0vRg== X-Gm-Message-State: AODbwcBY/vv5eq2dqepltsOBwfuGHYwSaoQS1MLNFEsmISl1FWv9O/Sw DEEo9LANk0X5THITLxw= X-Received: by 10.84.208.102 with SMTP id f35mr32678520plh.53.1496938158665; Thu, 08 Jun 2017 09:09:18 -0700 (PDT) Original-Received: from localhost (23.83.238.120.16clouds.com. [23.83.238.120]) by smtp.gmail.com with ESMTPSA id o2sm9759766pgq.44.2017.06.08.09.09.16 (version=TLS1_2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 09:09:17 -0700 (PDT) In-reply-to: <837f0m8qjp.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113405 Archived-At: On 2017-06-08 15:09, Eli Zaretskii wrote: >> From: Danny YUE >> Date: Thu, 08 Jun 2017 19:58:03 +0800 >> >> I was viewing some (well, lots of) old images using image+ in Emacs. >> Then I noticed that it opens new image slower and slower. >> I ran command `free -h` and noticed that my memory was almost totally >> consumed. >> Then I killed Emacs and memory consumption dropped to normal level. >> >> I suspect there is something wrong with it, because when I press "N" for >> `image-next-file`, the old image file is removed from buffer list, thus >> the memory consumed by it *should* be released... > > The memory isn't released immediately because Emacs caches images for > better performance. And even if Emacs does free the memory used for > the image and its buffer, it doesn't necessarily return that memory to > the OS; that depend on the build and the OS you are using. > > Try the command "M-x clear-image-cache". If that helps, you may wish > to customize your value of image-cache-eviction-delay. In fact `clear-image-cache` is not really an interactive command, it is a function. The current value of `image-cache-eviction-delay` is 300. I will try to set it to a smaller value and have a try. Thanks. Danny