Subject: Re: bug#38187: 27.0.50; No mouse-wheel scaling on images

From: Alan Third <[email-masked]>
Date: Thu, 21 Nov 2019 21:18:32 +0000

On Thu, Nov 21, 2019 at 01:00:53AM +0200, Juri Linkov wrote:
> >> -(defun image-increase-size (n)
> >> +(defun image-increase-size (&optional n event)
> >
> > Can we avoid mixing numerical argument with a mouse event?  It looks
> > unclean to me.  How about a simple wrapper that accepts a mouse event
> > and calls image-increase/decrease-size with a suitable arg?
> 
> So I installed a new patch with wrappers.
> 
> BTW, while testing it for image scaling on a quite small image file,
> Emacs consumed several GB of all available memory and almost all swap,
> before I noticed and evaluated M-: (clear-image-cache) that freed memory.
> 
> Memory leak?

Was this on X?

Emacs probably keeps a copy of the image in memory for each size until
the image cache is cleared or pruned.

I’m a little unsure exactly how the image cache works because there
appears to be a second level pixmap cache that I think should avoid
that, but I’m not sure.

-- 
Alan Third