Open ESchuderer opened 1 year ago
Useful linting tools to prevent such issues: https://github.com/cartant/eslint-plugin-rxjs https://github.com/cartant/eslint-plugin-rxjs-angular
Useful operator to unsubscribe on destroy: https://github.com/ngneat/until-destroy
Potential leak in PageLayoutComponent as the Subject is not completed
Solution, call complete (not unsubscribe!) during destruction
ngOnDestroy(): void {
this.section$.complete();
}
Observable profiler to check mem leaks: https://github.com/awerlang/observable-profiler
Describe the bug SAP Spartacus memory consumption doesn't free up with a few continuous concurrent requests (10+ requests). This causes the node.js process to run out of memory and all SSR requests to time out.
Memory grows quickly even for simple operations like opening the homepage, indicating a memory leak.
Tell us the version of Spartacus
To Reproduce Steps to reproduce the behavior:
Expected behavior Memory consumption stays low
Screenshots![Screenshot 2022-11-22 at 18 32 20](https://user-images.githubusercontent.com/1319416/203385452-f08ba79e-f1aa-41ee-a1b7-7ddaa37666f5.jpg)
Additional context Setting the cacheSize configuration according to https://sap.github.io/spartacus-docs/server-side-rendering-optimization/#configuring-the-ssr-optimization-engine helps to mitigate the issue, preventing OOM errors.
But SSR will still time out and redirect to CSR while impacting performance.
Setting the property inlineCriticalCss introduced by Angular 12 didn't mitigate the issue: