Open ESchuderer opened 2 years 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
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: