ng-packagr: Memory leak during build after upgrade to 15.1.0

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

Looks like ng-packagr 15.1.0 has a memory leak With ng-packagr 15.0.3 during our user-interface build ng-packagr has a memory usage ~1GB image with ng-packagr 15.1.0 memory usage goes to ~12GB and build never completes image Also CPU usage is a lot higher

I can use ng-packagr 15.0.3 with Angular 15.1 without any issues

How To Reproduce

I can’t find a reproduce also I can’t record CPU profile because my system almost freezes with such a high ram usage and I can’t do much

Expected Behaviour

Build should complete and memory usage should go back to normal

Version Information

Angular CLI: 15.1.0
Node: 16.16.0
Package Manager: yarn 1.21.1
OS: darwin x64

Angular: 15.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1501.0
@angular-devkit/build-angular   15.1.0
@angular-devkit/build-webpack   0.1501.0
@angular-devkit/core            15.1.0
@angular-devkit/schematics      15.1.0
@angular/benchpress             0.3.0
@angular/cdk                    15.0.4
@ngtools/webpack                15.1.0
@schematics/angular             15.1.0
ng-packagr                      15.1.0
rxjs                            7.5.7
typescript                      4.9.4
webpack                         5.75.0

ng-packagr:            15.1.0
@angular/compiler:     15.1.0
rollup:                3.9.1
typescript:            4.9.4

Please include all version numbers that might be relevant, e.g. third-party libraries

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Great so 15.1.0 is faster 😃, I will apply the changes and cut a release sometime today.

Thanks again.

Hi @SebastianPodgajny, thanks for the help to track this down. I belive I found the root cause. Can you please try to replace stylesheet-processor.js with https://gist.github.com/alan-agius4/02af085774f163fc959dfbb5d36d82c5

@SebastianPodgajny, can you check if setting NG_BUILD_MAX_WORKERS to 1 improves things for you?