Description
I'm submitting a Bug report
Your Environment
Software | Version(s) |
---|---|
Angular | 10.1.6 |
Angular-Slickgrid | 2.22.4 |
TypeScript | 4.0.3 |
Describe the Bug
It's been a couple of days that I'm trying to figure out why certain aspects of my angular application are slow. After much hassle I finally figure out that my destroyed components are not getting unloaded from memory. I use the memory tab in chrome tools, I take a snapshot of the heap and all my components are times the amount of time I switched between views, which is a big problem because this slows down the application a lot.
So I decided I'm going to take out most of the code and just have the skeleton of the components and have the ability to route between them and I kept removing code until the problem was gone. It turns out that as long as I don't add angular slick grid to my html component I'm fine. As soon as I add it, this problem happens.
It usually means that you might have even listeners that are still open, or something like that, that's preventing the GC to unload them from memory.
As a matter of fact I downloaded the Angular-Slickgrid project and ran the examples locally, and than ran the same memory test. And sure enough same problem the components keep piling up as I switch between them.
The strange thing is that if I compile Angular-Slickgrid in prod mode, I don't see any components in the heap (meaning to say I don't see any objects that end with the word component) nor do I see any objects that resemble the components in examples, why is that? The only thing I can find is SlickGrid and every click adds another instance in prod build as well.
If you can shed some light into this would be very much appreciated, I'm at loss what to do next.
Steps to Reproduce
as mentioned above just run the examples, keep toggling between components a couple of times. Then hit F12 to bring up Chrome Dev Tools, go to the memory tab, in the Heap snapshot option there's a Take snapshot button, hit that. Once the snapshot is loaded, you can filter by component, and you'll see that
Expected Behavior
Destroyed components should be garbage collected and should not persist in memory.
Current Behavior
Components are not being removed from the heap.
Possible Solution
Code Sample
The Angular-Slickgrid sample shows this problem