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

Aggressive terminal-notifier memory leak after failed test (v19.0.2) #2999

Closed
swhamilton opened this issue Feb 24, 2017 · 9 comments
Closed

Comments

@swhamilton
Copy link

swhamilton commented Feb 24, 2017

Bug

What is the current behavior?

There is an aggressive memory leak in the terminal-notifier process after running a failing test and passing the --notify flag.

Here's a minimal repo demonstrating the behavior:
https://github.com/swhamilton/jest-terminal-notifier-memory-leak

Jest version: jest-cli@^19.0.2
Current environment: OSX Sierra 10.12.3

@cpojer
Copy link
Member

cpojer commented Feb 25, 2017

cc @mikaelbr

@mikaelbr
Copy link
Contributor

Would have to investigate this some. Initially it looks like a problem with terminal-notifier: julienXX/terminal-notifier#173

@kusold
Copy link
Contributor

kusold commented Mar 1, 2017

screen shot 2017-03-01 at 9 45 17 am

I am also having this issue. Memory usage steadily has been climbing (and continues to). I was running Jest with watch mode.

❯ cat ./node_modules/jest-cli/package.json
{
  "name": "jest-cli",
  "description": "Painless JavaScript Testing.",
  "version": "19.0.2",
❯ brew info terminal-notifier
terminal-notifier: stable 1.7.1 (bottled), HEAD
Send macOS User Notifications from the command-line
https://github.com/julienXX/terminal-notifier
/usr/local/Cellar/terminal-notifier/1.7.1 (14 files, 2M) *
  Poured from bottle on 2016-12-08 at 11:34:37
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/terminal-notifier.rb
==> Requirements
Build: xcode ✘
Required: macOS >= 10.8 ✔

EDIT: Brew isn't responsible for the terminal-notifier. It is vendored with node-notifier (but it also appears to be using 1.7.1)

❯ ./node_modules/node-notifier/vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier -help
terminal-notifier (1.7.1) is a command-line tool to send OS X User Notifications.

@rmariuzzo
Copy link

I'm also having this same issue. If there's something I could provide to help, please let me know.

@nathanstitt
Copy link

I also see this with Jest version 19.0.2, terminal-notifier continues to spawn multiple children and use memory/cpu even after I exit Jest. FYI for anyone else experiencing this, a pkill -f terminal-notifier is an easy way to kill 'em all.

Using the brew version of terminal-notifier doesn't seem to help. I've attempted to replace node-notifier's bundled one with brew via cp /usr/local/bin/terminal-notifier ./node_modules/node-notifier/vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier

@mikaelbr
Copy link
Contributor

This is due to a error in terminal-notifier with the new reply functionality as seen in julienXX/terminal-notifier#173 (comment). Essentially the application keeps on running even after timeout and it keeps on accumulating memory through generating release strings on ObjC. Hopefully this will be fixed.

There is no need to installing terminal-notifier through brew or trying to install it manually. node-notifier handles this and will keep up to date with the terminal-notifier bundle. As soon as the memory leak is fixed upstream I'll do a patch release of node-notifier with the updated vendor file. As for now I've added a failsafe after 30 seconds and forcing timeout on node-notifier end. It is currently in master. I haven't had the time to test it properly but as soon as I'm able I'll release it. Hopefully this will prevent most of the issue. This should be a temporary workaround and it should be fixed permanently in the terminal-notifier package.

@cpojer
Copy link
Member

cpojer commented Mar 16, 2017

Closing this from the Jest side. Thanks @mikaelbr for working on this!

@alexilyaev
Copy link
Contributor

alexilyaev commented Jan 22, 2018

Looks like this can be resolved now, opened a ticket: #5365

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants