Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Arooba-git
Copy link

Hello 👋
As part of our project, we are using Facebook's new Memlab tool to detect memory leaks in SPA applications.
While running the tool and analyzing the code of defichain-income, we saw that your project does a very good job of ensuring that all async operations are cancelled when the component is destroyed. However, as per Memlab execution results, we found a dangling subscription and some timers that were causing the memory to leak (screenshots below).

[before]
Screen Shot 2023-01-28 at 7 02 49 AM


Hence we added the fix by unsubscribing the subscription and clearing the timers in component destructors, and you can see the heap size and # of leaks reducing noticeably:

Screen Shot 2023-01-28 at 7 12 29 AM

You can analyze this and other potential leak sources, if you like, by running Memlab with a scenario file covering the maximum # of use cases.
Following is a sample of the scenario file we used (it needs to be a .js file but attaching here in .txt form):

deficiain-memlab-scenario.txt

Note that some other reported leaks (in Memlab) originated from Angular's internal objects, and hence were ignored.

@Arooba-git
Copy link
Author

bump @rogi-sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant