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

Possible memory leak in idle app #1401

Closed
akhenry opened this issue Jan 13, 2017 · 10 comments
Closed

Possible memory leak in idle app #1401

akhenry opened this issue Jan 13, 2017 · 10 comments

Comments

@akhenry
Copy link
Contributor

akhenry commented Jan 13, 2017

Steps to reproduce

  1. Navigate to the app's default route (eg. http://localhost:8080/#). You should be taken to My Items, a folder view.
  2. In dev tools go the timeline tab, and hit record
  3. Trigger garbage collection (the trash can in the Timeline tab)
  4. Wait a while and do nothing (~100s should do it). It's important to keep the tab in focus though, otherwise setTimeouts won't happen.
  5. Trigger garbage collection again
  6. Heap does not return to original usage. Instead, looks something like this -

screen shot 2017-01-12 at 16 31 04

Sawtooth shape is due to regular minor garbage collections. Additionally there is one full GC at the start triggered manually, and two full GCs (triggered twice manually for good measure) at the end. Despite the two full GCs heap allocation does not return to its original size.

@evenstensberg
Copy link
Contributor

@larkin
Copy link
Contributor

larkin commented Sep 18, 2017

Pretty sure this is the sinewave generator, which accidentally keeps references to unsubscribe functions.

@unlikelyzero
Copy link
Collaborator

This is still an issue

@unlikelyzero unlikelyzero added this to Needs triage in Bug Tracker via automation Jun 10, 2022
@unlikelyzero unlikelyzero added this to Looked at in BC via automation Jun 10, 2022
@scottbell
Copy link
Contributor

scottbell commented Jun 24, 2022

I left "My Items" running for ~30 minutes, and 805 kbytes of new memory was allocated (big blue line before is garbage collection):
image

Here's the heap snapshot:
Heap-20220624T143929.heaptimeline.zip

@scottbell
Copy link
Contributor

Ran it again and saw ~350 kbytes of growth over ~30 minutes:
Screen Shot 2022-06-24 at 3 47 06 PM
Heap-20220624T154733.heaptimeline.zip

@akhenry looks pretty minimal to me?

@unlikelyzero
Copy link
Collaborator

@scottbell we have an automated test for this. Let's sync out of band

@akhenry
Copy link
Contributor Author

akhenry commented Jun 30, 2022

Running it in dev mode will always leak some amount of memory. Both Webpack HMR and Chrome dev tools are known to leak memory. @johnhill2 Did you observe the memory leak locally or in a production environment?

It's probably worth repeating this with a prod build (vanilla Open MCT is fine, doesn't need to be one of our deployments) so HMR isn't a factor. I bet those arrays are full of Webpack stuff.

@unlikelyzero
Copy link
Collaborator

@akhenry production environment on hulk during the STM Devsims on root folder menu

@scottbell
Copy link
Contributor

scottbell commented Jul 1, 2022

In production mode, memory was more flat:
image
42 kbytes/hour, so possibly 504 kbytes/12 hours
The application reserves 69.4 mb, so this would be 0.7% growth over 12 hours, which I think is within our tolerances, right @akhenry? I've attached the big fat heap dump:
Heap-20220701T164516.zip

@akhenry
Copy link
Contributor Author

akhenry commented Jul 6, 2022

@scottbell within tolerances, yup. Let's close this for now.

@akhenry akhenry closed this as completed Jul 6, 2022
Bug Tracker automation moved this from Needs triage to Done Jul 6, 2022
BC automation moved this from Looked at to Close Jul 6, 2022
@unlikelyzero unlikelyzero added this to Needs triage in Build 6 Blockers via automation Jul 17, 2022
@unlikelyzero unlikelyzero added this to To triage in Improve Test Coverage via automation Jul 17, 2022
@unlikelyzero unlikelyzero added this to the Sprint:2.0.7 milestone Jul 17, 2022
@unlikelyzero unlikelyzero moved this from Needs triage to Needs an automated test in Build 6 Blockers Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance impacts or improves performance severity:blocker type:bug
Projects
BC
Close
Build 6 Blockers
Needs an automated test
Development

No branches or pull requests

5 participants