JavaScript Memory Leaks and How To Fix Them

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ม.ค. 2025

ความคิดเห็น • 46

  • @SoftwareDeveloperDiaries
    @SoftwareDeveloperDiaries  2 ปีที่แล้ว +5

    And how do YOU guys detect and overcome memory leaks in your projects? Feel free to share your approaches below 😎

  • @omaryasser2727
    @omaryasser2727 6 หลายเดือนก่อน

    Your channel is very underrated, amazing job.

  • @aokaziz6815
    @aokaziz6815 ปีที่แล้ว +1

    Useful content with crystal clear explanation

  • @amiral367
    @amiral367 4 หลายเดือนก่อน

    Really good and very easy to understand and follow. I learned new things. Thank you ☺️

  • @AdarshNamboothiri
    @AdarshNamboothiri ปีที่แล้ว +1

    This video is surely going to be a life saver for me, Thank you

  • @fatimaiqra2169
    @fatimaiqra2169 7 หลายเดือนก่อน

    This video is really helpful, you explained very deeply, thanks a lot!

  • @paschalynukwuani6930
    @paschalynukwuani6930 2 ปีที่แล้ว +1

    You are so good with your explanation. Thank you.

    • @SoftwareDeveloperDiaries
      @SoftwareDeveloperDiaries  2 ปีที่แล้ว

      Happy to hear mate! Let me know if there's any topic you'd like me to make a video about :)

  • @salmanrana803
    @salmanrana803 2 ปีที่แล้ว +5

    Hey bro! Awesome content. In your third approach you are deleting the property "delete nodes.btn". But "useStrict" doesn't allow us to use "delete". What can be other way to do that?

    • @SoftwareDeveloperDiaries
      @SoftwareDeveloperDiaries  2 ปีที่แล้ว +1

      Hey hey, thanks for a great remark! Here's an article that I found, apparently it happens because the property is non-configurable. Maybe you can find something useful here :)
      developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_delete

  • @criticalthinker88gis13
    @criticalthinker88gis13 10 หลายเดือนก่อน

    Thanks, seems promising, ill try to use what i learned to identify and fix a mem leak at my now with it

  • @A.Lacivert
    @A.Lacivert ปีที่แล้ว

    Great information and excellent presentation.

  • @Ariel-g6m
    @Ariel-g6m ปีที่แล้ว

    Excellent and clear explanation, thanks:)

  • @isagive
    @isagive 2 หลายเดือนก่อน

    תודה רבה, עוזר מאוד.. 🙏

  • @luck-xc7dy
    @luck-xc7dy ปีที่แล้ว

    Hello, with the setTimeout memory leak. Does no variable ever get garbage collected inside of setTimeout, or is it just references to dom elements that dont get cleaned up. If you had node set = to 10 would it still have been a memory leak?

  • @itsall1sand0s
    @itsall1sand0s ปีที่แล้ว

    Amazing video❤ The fact that it has so less views and engagement makes me kinda sad

  • @brinthkr1533
    @brinthkr1533 ปีที่แล้ว

    Awesome explanation 🎉

  • @germanmartinezsolis9543
    @germanmartinezsolis9543 ปีที่แล้ว

    such a great video, I'm looking forward to see more content like this, you got a new sub.

  • @darrenpierre9903
    @darrenpierre9903 ปีที่แล้ว

    wow this is a great video . I'm curious where did you learn how to use the developer tools for memory and performance ? I haven't used those tabs in my work but would love to do so in the future

  • @paperC_CSGO
    @paperC_CSGO 8 หลายเดือนก่อน

    Please do more browser dev tools stuff, especially performance in a big live site with loads of requests going on

    • @SoftwareDeveloperDiaries
      @SoftwareDeveloperDiaries  8 หลายเดือนก่อน

      I'm thinking about making a separate course on JS performance, so stay tuned!

    • @paperC_CSGO
      @paperC_CSGO 8 หลายเดือนก่อน

      @@SoftwareDeveloperDiaries great news, thank you!

  • @Hala-os6ij
    @Hala-os6ij 2 ปีที่แล้ว

    a GREAT explanation. thank you so much

  • @SomewhatLazy
    @SomewhatLazy 4 หลายเดือนก่อน +5

    The setTimeout example is wrong. It doesn't hold on to the variable. It creates a new one every time and if 'node' doesn't exist in the DOM it will throw an error. Did you test any of this? Also not a good example of a memory leak.

  • @Petersonbabs
    @Petersonbabs 11 หลายเดือนก่อน

    great video. What tool are you using for this explanation

  • @MrFikret90
    @MrFikret90 ปีที่แล้ว

    This pretty interesting, but when it comes to determine memory leaks in app like Angular, it very difficult to find it. Because it's huge amount of functions in it, and names like "lj, H9, Xv"... not sure what all those functions comes from.
    Do you know how debug memory leaks in TypeScript apps? I believe it's after transpiler comes those names.

    • @SoftwareDeveloperDiaries
      @SoftwareDeveloperDiaries  ปีที่แล้ว

      Yes, you're right, it's quite challenging to find memory leaks when using JS frameworks. My suggestion would be to monitor the memory while you interact with the app, to at least be able to pin down the problem. Also, in the "Performance" tab, you can stumble upon you own methods, among framework-native methods, if you look close enough.

  • @duongnguyen8853
    @duongnguyen8853 10 หลายเดือนก่อน

    Hi, I am from VietNam, thank you for your video but I have a problem with my node server, I don't know how to debug the memory leaks in that Please help me, thank you so much

  • @고민영-y7s
    @고민영-y7s ปีที่แล้ว

    Great explanation❤❤
    Btw what is the tool u r using to draw and write ur explanation?

  • @sindhu1522
    @sindhu1522 6 หลายเดือนก่อน

    Hi i have an issue with my nestjs application even there is no api calls from day 1,the cpu usage is increasing gradually, could you please share any idea how to fix that

    • @pavelk2667
      @pavelk2667 2 หลายเดือนก่อน

      Do you have schedules under the hood? First of all, ensure that your measures are right, sometimes people do measures improperly. Then start with cutting modules one-by-one

  • @탐훈
    @탐훈 ปีที่แล้ว

    Wow Thanks a lot. It's what I want to know

  • @SomewhatLazy
    @SomewhatLazy 4 หลายเดือนก่อน +1

    Symptoms
    1. Page unresponsive. NOT A MEMORY LEAK! ALMOST ALWAYS RECURSION.
    2. Slow browser. COULD BE A MEMORY LEAK. NOT A GUARANTEE.
    3. Slow OS. AGAIN, COULD BE A MEMORY LEAK. LIKELY COMPLETELY UNRELATED.
    Very bad examples.
    The only valid examples, which you didn't even mention, are:
    1. Browser or tab crashes with out of memory error.
    2. Task Manager shows your browser is using a tremendous amount of memory.
    That is it.

    • @SomewhatLazy
      @SomewhatLazy 4 หลายเดือนก่อน +1

      I think you don't understand how garbage collection works either.

  • @ulashofficial
    @ulashofficial 2 ปีที่แล้ว +1

    Thank you very much Software Developer Diaries! Fuuuuuuuuuuuuu

    • @ru2979
      @ru2979 ปีที่แล้ว

      wait what his name is foooo 👀😳🌬️🌬️🌬️?

  • @gaurishrane9818
    @gaurishrane9818 ปีที่แล้ว

    Very use full video ..