Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many "Emacs Web Content" processes created and never killed #380

Open
brendan-m-murphy opened this issue Jul 31, 2024 · 4 comments
Open

Comments

@brendan-m-murphy
Copy link

Activity monitor shows many "Emacs Web Content" processes:
image

I'm not sure how many there are, but well over 100. It's hard to find these using ps and I'm not sure how Activity Monitor decides to label them as "Emacs Web Content". The parent process is listed as launchd, they tend to use less than a second of cpu time.

Their "open files and ports" look like:

/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc
/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
/System/Library/CoreServices/SystemVersion.bundle/en_GB.lproj/SystemVersion.strings
/private/var/db/timezone/tz/2024a.1.0/icutz/icutz44l.dat
/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Resources/en.lproj/Localizable.strings
/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Resources/en.lproj/Localizable.stringsdict
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/SystemAppearance.car
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/FauxVibrantLight.car
/Library/Preferences/Logging/.plist-cache.wIUS3Pas
/usr/share/icu/icudt74l.dat
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Aqua.car
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/VibrantLight.car
/System/Library/Fonts/Times.ttc
/System/Library/Fonts/Monaco.ttf
/private/var/folders/wt/4vh3gw2x4jlgcjsphz5wqgmh0000gp/0/com.apple.LaunchServices.dv/SystemDataOnly-com.apple.LaunchServices-5028-v2.csstore
/dev/null
/dev/null
/dev/null
->0x784796543e355992

I'm not sure what this means, other than maybe it is trying to access fonts.

I'm essentially only using org-mode, magit, shell, and python lsp. I'm not sure what is responsible for creating these processes.

Eventually, emacs hangs for several seconds when doing basic text editing, and I have to close it, then manually close all of these processes (or try to kill them by filtering ps results by PID and CPU time).

I'm happy to investigate more, but I don't really know where to start.

@sleetdrop
Copy link

I encountered this when open and close svg file multiple times. Describes in this issue #366

'Emacs Web Content' is a process's localizedName, I wrote a tool to kill all of them with the help of chatgpt in swift.
I put it in this gist.
https://gist.github.com/sleetdrop/e770dc5caf4fa9897f348899d86e06ad

Compile it in xcode, and pass "Emacs Web Content" as parameter to kill all of them.

It maybe related code here
https://bitbucket.org/mituharu/emacs-mac/src/65c6c96f27afa446df6f9d8eff63f9cc012cc738/src/macappkit.m#lines-14049:14071 and here https://bitbucket.org/mituharu/emacs-mac/src/65c6c96f27afa446df6f9d8eff63f9cc012cc738/src/macappkit.m#lines-14242:14256

Which are responsible for reusing and releasing of webkit instance for viewing SVG, but I am not familiar with macOS development, I have not found why, anyone familiar with emacs and macOS(objc) can dig more into this issue.

@brendan-m-murphy
Copy link
Author

brendan-m-murphy commented Aug 10, 2024

Thanks for the script! I saw the svg issue. I'm not explicitly creating svg's, but maybe something in doom emacs is.

@brendan-m-murphy
Copy link
Author

For anyone else with this problem, my method now is to go to activity monitor, search for "Emacs Web Content", do edit select all, copy, then call for x in $(pbpaste | awk '{ print $10 }'); do kill -s 9 $x; done. I usually do pbpaste | head | awk '{ print $10 }' first to check that I'm getting the PIDs.

@nomm-dot
Copy link

Also having this issue. Unfortunately, it's on my work macbook, so I don't have the time or expertise to do much about it other than kill the processes. Hope this gets resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants