Javascript / jQuery - How to find a memory leak in my large amount of code?

I wrote a lot of code for the site that I am developing, and only now I realized that it has a memory leak. I noticed that Firefox was running quite slowly during the day and checked my task manager to find it idling at 600,000 K.

It seemed strange, and so I killed / restarted it. Then I realized that, watching the task manager, the more I played with my site, the higher the memory usage in Firefox.

Now I have a lot of code ... I do not want to transcode it and try to do it better this time. So how can I view my code and identify memory leaks? These are almost all jQuery stuff (click bindings, changes, etc.) and AJAX (using jQuery user interface tabs).

How can I fix this? > & L;

+3
source share
1 answer

You need to use a JavaScript profiler, for example this addon for Firefox. This will help you find a memory leak, and you will have to fix it.

0
source

Source: https://habr.com/ru/post/1759261/


All Articles