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.

Possible memory leak

See original GitHub issue

Bug Report

I’m pretty sure I have a memory leak on the universal side of things, although I may be wrong as I’m no expert with memory leaks.

The screenshot is a series of snapshots after refreshing the same page a few times (and I mean a few times)

One thing that seem to be growing is string containing the page html so I’m assuming this will be something to do with the express engine.

screenshot 2018-11-01 at 15 53 33

my implementation is

app.engine(
  'html',
  ngExpressEngine({
    bootstrap: AppServerModuleNgFactory,
    providers: [
      provideModuleMap(LAZY_MODULE_MAP),
    ]
  })
);

What modules are related to this issue?

- [ ] aspnetcore-engine
- [ ] common
- [x] express-engine
- [ ] hapi-engine
- [x] module-map-ngfactory-loader

Minimal reproduction with instructions:

https://github.com/dottodot/ang6-test

It can been seen in a basic repo but the growth is much slower but I put that down to the content being render is much more simple.

What is the use-case or motivation for changing an existing behavior?

Environment:

@nguniversal versions

  • aspnetcore-engine:
  • common:
  • express-engine:
  • hapi-engine:
  • module-map-ngfactory-loader:
<!--
Output from: `ng --version`.
If nothing, output from: `node --version` and `npm --version`.
  Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
-->

Angular CLI: 7.0.3 Node: 8.12.0 OS: darwin x64 Angular: 7.0.2 … animations, cdk, common, compiler, compiler-cli, core, forms … http, language-service, material, material-moment-adapter … platform-browser, platform-browser-dynamic, platform-server … router, service-worker

Package Version

@angular-devkit/architect 0.10.3 @angular-devkit/build-angular 0.10.3 @angular-devkit/build-optimizer 0.10.3 @angular-devkit/build-webpack 0.10.3 @angular-devkit/core 7.0.3 @angular-devkit/schematics 7.0.3 @angular/cli 7.0.3 @angular/pwa 0.10.3 @ngtools/webpack 7.0.3 @schematics/angular 7.0.3 @schematics/update 0.10.3 rxjs 6.3.3 typescript 3.1.5 webpack 4.19.1

Is there anything else we should know?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
dottodotcommented, Nov 2, 2018

OK I believe I found the cause.

I have a carousel on my site that uses Flickity which is dependant on window and I was using the following to stop the window is not defined error.

const win = domino.createWindow(template);
global['window'] = win;
global['document'] = win.document;

Not sure why this causes the memory leak but wrapping my carousel with a isBrowser check seem to prevent the leak happening.

  <ng-container *ngIf="isBrowser">
  </ng-container>
0reactions
angular-automatic-lock-bot[bot]commented, Sep 4, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My system scan results says "An active process has a possible ...
My system scan keeps telling me "An active process has a possible memory leak (Microsoft EdgeCP.exe)
Read more >
How do I check for memory leaks, and what should I do to stop ...
To find a memory leak, you've got to look at the system's RAM usage. This can be accomplished in Windows by using the...
Read more >
Fix: An Active Process Has a Possible Memory Leak
If you encounter a possible memory leak, it means that a program is using an excessive amount of memory, and your system is...
Read more >
Memory leak / Handle leak | Firefox Support Forum
Here is a fairly simple explanation for a memory leak: A Memory leak occurs when your computer closes an open program and that...
Read more >
Memory leak - Wikipedia
In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in...
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