-
Notifications
You must be signed in to change notification settings - Fork 330
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
Memory Leak? #173
Comments
Which version do you use? |
It updated over home brew this morning, but I believe it is version 1.7.0 |
Could you try this version https://github.com/julienXX/terminal-notifier/releases/tag/1.7.1 and tell me if it's better? (Not yet available via homebrew) |
ok, I'll give it a whirl and keep you posted Thank you :) |
I managed to reproduce the issue when using |
You're 1.7.1 update did the trick @julienXX I've had no more "leaks". The only thing I had to do after I applied it was reboot my Mac... I am invoking Terminal Notifier via a Script BTW ;) |
@frdmn do you have the issue under 1.7.1? |
@julienXX I was using the homebrew / Ruby wrapper of the binary. How can I extract just the When I just copy it from
|
@frdmn 1.7.1 is available via homebrew or you can download the executable here https://github.com/julienXX/terminal-notifier/releases/tag/1.7.1 |
@julienXX Ah great, just got the update in brew. I'm not sure how to reproduce the problem precisely, but for now none of the processes are stuck and memory looks good as well. 👍 I'll let you know if the problem still occurs with 1.7.1 |
Great, I close the issue, feel free to re-open it if needed. |
Could this still be a problem? https://github.com/swhamilton/jest-terminal-notifier-memory-leak cc @swhamilton |
I am having the same issue that @mikaelbr is seeing using Jest with terminal-notifier 1.7.1 updated via homebrew. |
@julienXX The original code was written with the idea that the app would always exit asap after delivery. I see that nowadays there’s the possibility for the app to remain running when I don’t know how long it can remain ‘present’ nor have I done anything else than skim through the source, but it does look like that might be the source of the leak, as it continuously generates autoreleased strings which will never get released (until the app exits). I suggest you create the string with hash once outside of the |
Shouldn't |
I don't yet have a fix but I'm working on it. The code for the reply option was merged from https://github.com/vjeantet/alerter and it seems the leak was already there. |
@julienXX Is this still being worked on? |
@mikaelbr yes it is but I'm having a hard time figuring out the proper fix. |
I see. I don't have any ObjC experience, so not much help there I'm afraid. But looks to me like the main source is the endless loop as alloy suggests. Also, are we sure checking in As for optimizing the loop it self, it looks like the entire
can be moved to above the do-while, also as @alloy says. Looks like maybe the current code is from http://stackoverflow.com/questions/21110714/mac-os-x-nsusernotificationcenter-notification-get-dismiss-event-callback but there another identifier is used. |
@julienXX If you have any questions or want to pair, let me know. |
@mikaelbr @alloy tried some updates https://gist.github.com/julienXX/bb076b0b95c738217b03e14e51f23876 but still no luck. Leaking is reduced but still there. If you have some ideas to try I'm all ears. |
Could you reuse declared arrays and other values for each iteration of the loop? Now you allocate a new array in the memory for each step, no? |
@mikaelbr updated the gist but not better unless I misunderstood your comment. |
@mikaelbr @killianbrackey @frdmn @takuhii the leak has been found and fixed thanks to @alloy help. I released 1.7.2 with the fix. Soon available via homebrew too. |
No sure what's happening here, but I have Terminal Notifier running in 5 Terminal windows, but it is consuming GBs of memory, so much so my Macbook stops working...
The text was updated successfully, but these errors were encountered: