RxJS subscriptions that never end
Subscriptions without the async pipe, takeUntilDestroyed or toSignal live on after the component is destroyed – keeping the component, its template and its data in memory.
Does your Angular app start smoothly but get slower the longer people use it – until only a reload helps? Then it's probably keeping objects in memory that it should have released long ago. I track down these memory leaks in four clear phases, fix them and use repeatable measurements to prove that memory usage stays stable.
A memory leak rarely shows up right away. Every navigation leaves something behind: component instances, detached DOM nodes, data held by subscriptions. After hours of use the browser tab takes up several hundred megabytes, garbage collection runs more and more often and the UI starts to lag.
The chart shows such a measurement: the red line keeps climbing with every navigation. After the fix, the blue line shows the typical sawtooth pattern of a healthy web application – memory is allocated and released again.
Subscriptions without the async pipe, takeUntilDestroyed or toSignal live on after the component is destroyed – keeping the component, its template and its data in memory.
Manually registered listeners on window or document, setInterval and observers (resize, intersection, mutation) that aren't removed in ngOnDestroy or via DestroyRef.
Charts, editors, maps or viewers whose destroy or dispose method is never called leave detached DOM nodes and internal references behind.
Services with providedIn: 'root' that collect data, components or callbacks but never clean up grow with every navigation.
Each phase has a clear goal, so you always know where we are – and at the end, measurements rather than assumptions show that the leaks are fixed.
Phase 1 of 4
I set up the software environment and build the frontend and backend so they can run locally or in a test environment under production-like conditions.
Goal: A running system that can be measured reproducibly.
Phase 2 of 4
Together with you, I identify the critical navigation paths and components – the workflows that are repeated most often in daily use or where the problems occur.
Goal: A prioritised list of suspicious paths and a reliable baseline measurement.
Phase 3 of 4
I analyse the suspicious components in detail using heap snapshots and retainer chains in Chrome DevTools. AI assistance helps map findings to the source code faster – the measurements have the final say.
Goal: Fixed leaks, with the root cause documented for each finding.
Phase 4 of 4
The Playwright tests from the analysis phase run again under the same conditions. Comparing them with the baseline shows whether memory is released again.
Goal: Proof that the leaks are fixed – and tests that catch new leaks early in the future.
On request
Is it not just about memory, but also rendering, load time or change detection? Then take a look at Angular performance optimisation.
Mr Birke was instrumental in the design, development, and stabilisation of our system. In collaboration, Mr Birke demonstrated a very reliable, independent, and transparent working style. I recommend Fabian Birke unreservedly for MedTech and HealthTech projects.
Normal memory usage rises and falls again – the sawtooth pattern. With a leak, the heap no longer drops back to its baseline after garbage collection but keeps growing every time a workflow is repeated.
DevTools help me find the cause. Playwright repeats a workflow hundreds of times under the same conditions. That's what makes small leaks visible and lets us prove objectively that a fix works.
For the setup phase I need a running system – either the source code of frontend and backend or access to a test environment. We'll work out which makes sense in the initial call.
Yes. The tests can be added to your CI pipeline so new leaks are caught before they reach production.
Briefly describe which workflow makes your app slower – I'll tell you how I would set up the analysis.