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: Free images based on allocated memory Date: Wed, 30 Jan 2019 17:46:02 +0200 Message-ID: <83y3721745.fsf@gnu.org> References: <875zu7thqq.fsf@hochschule-trier.de> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="32876"; 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 Wed Jan 30 16:47:23 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 1gos5C-0008Pp-8i for ged-emacs-devel@m.gmane.org; Wed, 30 Jan 2019 16:47:22 +0100 Original-Received: from localhost ([127.0.0.1]:40081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gos5A-0001cP-Vb for ged-emacs-devel@m.gmane.org; Wed, 30 Jan 2019 10:47:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gos42-0001ZT-PA for emacs-devel@gnu.org; Wed, 30 Jan 2019 10:46:11 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gos42-0001Xr-5A; Wed, 30 Jan 2019 10:46:10 -0500 Original-Received: from [176.228.60.248] (port=3447 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gos41-0007dp-Oc; Wed, 30 Jan 2019 10:46:10 -0500 In-reply-to: <875zu7thqq.fsf@hochschule-trier.de> (message from Andreas Politz on Tue, 29 Jan 2019 19:56:45 +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:232831 Archived-At: > From: Andreas Politz > Date: Tue, 29 Jan 2019 19:56:45 +0100 > > Recently there was a discussion about how to limit the amount of memory > the pdf-tools package uses by means of the image-cache. > > The package renders pages to a PNG image, each one having a size of a > couple of MB. Thus, skimming through a large document can quickly fill > the cache with images in the GB range. > > Anyway, it occurred to me, that freeing the cache via clear-image-cache > etc. is much like counting conses and triggering garbage-collection > manually. So I wondered if there is some interest to add an automatic > eviction of the cache based on it's current size. We already clear the image caches from time to time, see clear_face_cache. If that is not good enough for some reason (and if so, can you explain why?), would it make sense to enhance what we already have, rather than invent a new mechanism? Thanks.