From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: AW: Re: AW: Re: Free images based on allocated memory Date: Mon, 04 Feb 2019 20:17:15 +0200 Message-ID: <835ztzv2ok.fsf@gnu.org> References: Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="121579"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Andreas Politz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 04 19:17:52 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqioZ-000VXa-HV for ged-emacs-devel@m.gmane.org; Mon, 04 Feb 2019 19:17:51 +0100 Original-Received: from localhost ([127.0.0.1]:47072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqioY-0000NR-IJ for ged-emacs-devel@m.gmane.org; Mon, 04 Feb 2019 13:17:50 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqioN-0000LZ-Re for emacs-devel@gnu.org; Mon, 04 Feb 2019 13:17:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqioN-0005u8-4q; Mon, 04 Feb 2019 13:17:39 -0500 Original-Received: from [176.228.60.248] (port=4386 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gqioG-0006Ez-Nf; Mon, 04 Feb 2019 13:17:37 -0500 In-reply-to: (message from Andreas Politz on Mon, 04 Feb 2019 17:42:32 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:232971 Archived-At: > Date: Mon, 04 Feb 2019 17:42:32 +0100 > From: Andreas Politz > Cc: emacs-devel@gnu.org > > The patch limits the amount of memory Emacs may use for an image-cache. This if what my users want and > it means I don't have to implement it in Lisp. So, given the cache has still vacancy left, I can preload not yet > displayed images into it knowing they stay there. Using the existing time-based mechanism doesn't really > work here: Either the limit is to short and thus pre-loaded images are evicted before they can be displayed. > Or it is to long and the image-cache becomes undesirable large. Did you try this code when there's only one or two large images being displayed in some window, such that each one of the images individually exceeds the memory limit set by the variable your patch introduces? Doesn't this cause Emacs to constantly free and then immediately re-process the image again and store it in the cache, e.g., as you scroll the window to bring the image in and out of view? Please also note that I installed a change today that prevents a frame's image cache from being altered while the display engine works on that frame. This caused Emacs to segfault in some convoluted situation. Thanks.