Fix critical memory leaks causing 2.89GB usage on macOS Sequoia#335
Open
huynguyenh wants to merge 1 commit intodevelopfrom
Open
Fix critical memory leaks causing 2.89GB usage on macOS Sequoia#335huynguyenh wants to merge 1 commit intodevelopfrom
huynguyenh wants to merge 1 commit intodevelopfrom
Conversation
- Add [weak self] to DispatchQueue closures to prevent retain cycles - Implement deinit in StatusBarController and PreferencesViewController to clean up NotificationCenter observers - Fix NSStatusItem to only create once and properly remove with removeStatusItem() - Deactivate NSLayoutConstraints before removing views to prevent constraint memory leaks - Update macOS deployment target from 10.12 to 10.13 (required by HotKey dependency) These fixes resolve the cumulative memory leak that caused the app to grow to 2.89GB over time on macOS Sequoia. Testing shows 79% reduction in memory growth on repeated operations. Fixes #326
Member
|
cool, thanks @huynguyenh , lemme check this on weekend 🙏 |
|
I'm glad someone found the cause of this...any possibility of expediting a release with this fix? It's really killing my Mac. Thank you. |
|
When will this fix get merged? |
|
hey @phucledien, any news? really not trying to pressure you as this is open source and whatnot but this is really an important fix as the majority of people have at most 16GBs of RAM (due to, you know, pricing) I only noted this problem in macOS 26 though... |
|
I had to dump hidden and change to ice (beta build) to resolve for me. |
|
Having this merged would be much appreciated. The memory leak problem is really annoying |
|
@phucledien When will this PR be merged? Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Causes Identified
Fixes Implemented
1. DispatchQueue Closure Memory Leaks
Files: StatusBarController.swift:69-71, 142-144
2. NotificationCenter Observer Cleanup
Files: StatusBarController.swift, PreferencesViewController.swift
3. NSStatusItem Proper Lifecycle
File: StatusBarController.swift:244-262
4. NSLayoutConstraint Memory Leak (Critical)
File: StackView+Extension.swift:14-15
5. Timer Cleanup
File: StatusBarController.swift deinit
6. Deployment Target Update
File: project.pbxproj