question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ivy is leaking memory

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/core@9.0.0-rc.14 and earlier versions as well.

Is this a regression?

Yes, the previous version in which this bug was not present was: View Engine

Description

Ivy is leaking memory by holding onto component references in some manner.

πŸ”¬ Minimal Reproduction

https://ng-run.com/edit/tvqV5P78BchpccNmW4XU?open=app%2Fapp.component.ts&aot=true

All this application does is create a dynamic component (TabComponent) and then immediately destroy it, within the AppComponent ngOnInit method.

In Chrome, take a memory heap snapshot of the β€˜ng-run-preview.firebaseapp.com’ instance. Search for tabcomponent: image …the destroyed component is still in memory.

On the left-hand sidebar of ng-run, click β€œBase Project” and then turn β€œIvy AOT” off.

After the app reloads, take another heap snapshot and perform the same search. image …the destroyed component is gone from memory, which is expected.

Note: This issue might be related to #35148

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
Achilles1515commented, Feb 5, 2020

@christianliebel, as I referenced your issue.

2reactions
Achilles1515commented, Feb 24, 2020

@Achilles1515 ha! you are right. Regarding LComponentView_TabComponent - my understanding is that it should be present in the dev mode only (window.ngDevMode being truthy). A project build with AOT in production mode should not have this problem.

Cool. So I believe this issue can be closed. Yeah…ng-run is great, but finicky. I also just recently realized that the ng-run.preview.firebaseapp.com heap dumps share memory across open tabs. So I really should have said β€œClose all incognito windows and open the ng-run in a fresh one”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Memory Problems - Axon Ivy Community
If you have a memory leak then your Axon Ivy Engine is getting slow after some time (hours, days). You may get OutOfMemoryException...
Read more >
Solving Memory Leaks Issues in Ionic Angular - Cartona
We found that in Angular 9, Ivy is leaking memory and it doesn't deallocate memory of destroyed components correctly. In this issue you...
Read more >
[#IVY-1362] Memory leak and infinite loop in ModuleId.java
ModuleId tries save memory by interning objects. This ModuleId cache is not synchronized and when it is mutated from concurrent threads itΒ ...
Read more >
'RE: Subant calls utilizing Ivy leak memory' - MARC
[next in thread] List: ivy-user Subject: RE: Subant calls utilizing Ivy leak memory From: "Gilles Scokart" <gscokart () gmail ! com> Date: 2007-08-13Β ......
Read more >
Memory Leak: Quick Sync (Hardware Acceleration)
Some versions of the Intel Graphics Driver cause a memory leak ... On systems with this problem, memory... ... 3rd Generation (Ivy Bridge)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found