railwaycat / homebrew-emacsmacport

Emacs mac port formulae for the Homebrew package manager
BSD 2-Clause "Simplified" License
1.67k stars 125 forks source link

By everting image-mode svg buffer got many instances of 'Emacs Web Content' processes #366

Open sleetdrop opened 10 months ago

sleetdrop commented 10 months ago

Installed from homebrew, with the following version and build params


Warning: Treating emacs-mac as a formula. For the cask, use railwaycat/emacsmacport/emacs-mac
==> railwaycat/emacsmacport/emacs-mac: stable emacs-29.1-mac-10.0, HEAD
YAMAMOTO Mitsuharu's Mac port of GNU Emacs
https://www.gnu.org/software/emacs/
/opt/homebrew/Cellar/emacs-mac/emacs-29.1-mac-10.0 (4,394 files, 168.7MB) *
  Built from source on 2023-11-15 at 00:31:38 with: --with-natural-title-bar --with-starter --with-native-compilation --with-xwidgets --with-modern-icon --with-imagemagick --with-librsvg
From: https://github.com/railwaycat/homebrew-emacsmacport/blob/HEAD/Formula/emacs-mac.r

Reproduction step:

  1. open a svg file
  2. press g to revert it
  3. repeat step 2 a few times
  4. press q to close the image buffer
  5. got many Emacs Web Content processes left
Screenshot 2023-11-15 at 10 44 50 Screenshot 2023-11-15 at 10 45 37
ph7 commented 9 months ago

I have the exact same problem, using the 29.1 10.0-23.4 ARM release on macOS 13.6.2. This issue manifests itself in a very debilitative way for latex previews in org-mode (I am using dvisvgm): every single rendering of an svg image creates a new "Emacs Web Content" process, which never, ever, gets reclaimed. This leads to hundreds of processes after 10 mins of org-mode authoring, slowing down Emacs, then freezing it completely to the point that "force quitting" Emacs becomes the only option left.

I tried to install locally the librsvg-devel port, based on https://github.com/railwaycat/homebrew-emacsmacport/issues/312, hoping to avoid the use of WebKit for rendering svg images, but it did not work (WebKit is still getting used).

If I go to back to the 28.1 release, everything works again (a single "Emacs Web Content" process at any single time, independently of the number of SVG images rendered). This is my current coping strategy, but fixing SVG rendering in 29.1 would be great…

sleetdrop commented 9 months ago

After submitting issue here, I found that this repo is just a mirror, and in the README, the author said would only accept bug by email, and suggested to reproduce it in the official builds first.

@ph7 If you have time, you can help to try to reproduce this bug in the official builds, If you don't have time, I will try to do this in the next week when I am not busy.