Debugging memory leaks - HTTP 203

Поділитися
Вставка
  • Опубліковано 24 сер 2024

КОМЕНТАРІ • 86

  • @jakearchibald
    @jakearchibald 3 роки тому +50

    I've added a link to the leaky version of Squoosh in the description, in case you want to follow along

  • @hypersonic12
    @hypersonic12 3 роки тому +83

    For me, this was one of the most useful episodes so far, on a tool I have mostly avoided thus far. Also it felt like reading a suspense novel after every “success.” Thanks for the great walkthrough!

  • @itsdevdom
    @itsdevdom 3 роки тому +24

    These episodes could be an hour long and I wouldn't mind. Great content as always!

  • @mc-ty4br
    @mc-ty4br 3 роки тому +14

    I feel like we're passively/partly enabling Apple to keep on slowing down the web by supporting its browser.
    Sometimes, I just wanna add a banner telling people to use a proper browser.
    In my last job I had a native datepicker, and for safari, i had a input/text with clickable question mark next to it that alerted "your browser does not support date pickers, please enter date manually dd-mm-yyyy"

    • @dhkatz_
      @dhkatz_ 2 роки тому +2

      This seems like an uninformed answer. All three major browsers do a great job in certain areas and less than great in others. None of the development teams *want* any of these bugs to exist, they're bugs. Safari is usually not too slow to fix things like this anyways.

  • @cintron3d
    @cintron3d 3 роки тому +27

    Really informative and entertaining as always, so glad you're back!

  • @gabrielmachado7315
    @gabrielmachado7315 10 місяців тому +1

    I work on a big typescript application, and memory leaks haunt us from all places, kind of 70% us, 20% libraries, 10% browsers fault. Sometimes I think it would be easier if we write everything in C.

  • @technikhil314
    @technikhil314 3 роки тому +4

    Am I the only one who likes video before watching it fully?
    My mind after watching this video: Lets run and analyze memory on every site that we have created. :)

    • @jakearchibald
      @jakearchibald 3 роки тому +3

      Everyone should do this, I reckon

    • @technikhil314
      @technikhil314 3 роки тому

      @@jakearchibald Yup Cant agree more. I would spread the word for you for free. But there is hardly anyone who listens to me :)

  • @wladmeixner76
    @wladmeixner76 3 роки тому +2

    Exactly the procrastination I needed while learning for my exams, really glad to see you’re back!

  • @robertosantanaperdomo9388
    @robertosantanaperdomo9388 3 роки тому +2

    Wow, guys! Keep it up with this format, I loved it. It has been one of the episodes I've learned the most and I can actually use this to solve my everyday problems.

  • @HazzMan2409
    @HazzMan2409 3 роки тому +3

    Jake and Surma are the Messi and Ronaldo of the software dev world 😄 Constantly amazed by their smarts and I’m thrilled that they share it with us mere mortals!

    • @saidooubella
      @saidooubella 2 роки тому

      They're more like Chet and Romain from Android staff!

  • @dynamics
    @dynamics 3 роки тому +2

    Yay! Thank you! Google Chrome Developers series is my favorite! 😄

  • @switchfoot-7777
    @switchfoot-7777 3 роки тому +3

    Haven't watched fully yet.
    But last mem leak issue i had was related to Audio context, the mem used there cannot be seen in devtools and must use taskmanager.
    That day i learnd that mp3 loaded into an js context takes 10x the filesize in mem.

    • @jakearchibald
      @jakearchibald 3 роки тому +2

      Decoded audio will always take up more space than compressed audio (like decoded images in this episode), but please file a bug about the lack of attribution in devtools!

  • @spidfire
    @spidfire 3 роки тому +7

    Epic, I never know how to tame the memory tab. Could you maybe do other features of the inspector in following episodes?

  • @mc-ty4br
    @mc-ty4br 3 роки тому +2

    That was worth the wait. Thank you all, it was great 👌

  • @duncan-dean
    @duncan-dean 3 роки тому +4

    Such a good episode!

  • @luluakram
    @luluakram 3 роки тому

    that safari memory usage,, 1.2 GB by the end.. that's just surprising. thank you for the video, super helpful.

  • @r0ger80
    @r0ger80 3 роки тому +5

    its funny that even a google channel makes fun of Chrome`s memory usage problem xD

    • @kalleguld
      @kalleguld 3 роки тому

      It's not a problem, it's a feature. Since everything you do should be on the web anyway, the browser might just as well use all your memory :)

  • @autodidact2590
    @autodidact2590 2 роки тому

    It's great learning things. Awesome explanation. If video gets longer.please keep it following video as part - 2 so on. It's helps alot in understanding the things under the hood.

  • @shamsartem
    @shamsartem 3 роки тому

    guys you are the best. this content is pure gold

  • @SudharshaunMugundan
    @SudharshaunMugundan 3 роки тому

    I like how they gently pulled the leg of Safari and Firefox :P

  • @LeeSmith-cf1vo
    @LeeSmith-cf1vo 3 роки тому +1

    I'm liking the new "studio", although those raining artifacts are really annoying.
    I think it would be useful to have a similar episode to this but talking about the DOM itself. How can we minimise the memory usage when we have a very large DOM?
    Also, it seems like it would be useful if those memory tools had a button that can remove from the snapshot anything that is _only_ referenced by the console

  • @thomasmeerpohl2438
    @thomasmeerpohl2438 3 роки тому +1

    the studio seems professional but the audio is somehow bad.

    • @jakearchibald
      @jakearchibald 3 роки тому +1

      Yeah, we had some sound issues in this series, sorry about that.

  • @tkv559
    @tkv559 3 роки тому +1

    Wow this feels great, learn many things here

  • @ctna211
    @ctna211 11 місяців тому

    Insightful and lovely convsersation! thanks.

  • @gouravkhator
    @gouravkhator 3 роки тому

    Both were event listeners, that's great

  • @shubhamlatiyan7972
    @shubhamlatiyan7972 3 роки тому +1

    Awesome information guys

  • @FallingDreamFlowingSand
    @FallingDreamFlowingSand 2 роки тому

    Thanks for this episode, it was very informative.

  • @waldemarenns4874
    @waldemarenns4874 3 роки тому

    4:18 - my favorite scene 🤯😂😂😂

  • @weizhiyang6873
    @weizhiyang6873 Рік тому

    This is really helpful video! Thanks a lot!

  • @ruby_gleyzes
    @ruby_gleyzes 2 роки тому

    Great video!

  • @DenisTRUFFAUT
    @DenisTRUFFAUT 3 роки тому

    Great episode !

  • @rishabhanand4270
    @rishabhanand4270 3 роки тому +1

    you guys are the best

  • @pdkama
    @pdkama 3 роки тому +1

    nice content, well presented. Thanks

  • @hashzones
    @hashzones 2 роки тому

    very useful and interesting, memory leaks debugging is always dev-time leaks :S

  • @mayankvora8116
    @mayankvora8116 Рік тому

    What a great explanation 👍

  • @M2Pochomkin
    @M2Pochomkin 3 роки тому +1

    Where is upvote 100 times button

  • @riddixdan5572
    @riddixdan5572 3 роки тому

    Would be awesome if we could do something similar in node.

  • @victornpb
    @victornpb 3 роки тому

    The trash can with an X in the top right is a CollectGarbage button in Safari

    • @jakearchibald
      @jakearchibald 3 роки тому

      hah, I think I assumed that was "delete". Same UI problem as Chrome.

  • @NitinPasumarthy
    @NitinPasumarthy 3 роки тому

    Another insightful conversation / presentation. Thank you! Is there a way to detect these leaks in production via RUM?

  • @krasimirk
    @krasimirk 3 роки тому

    Wow great. nice point of logging in console is breaking memory usage. keep going

  • @aymanpatel5862
    @aymanpatel5862 3 роки тому +1

    So you use a memory leak profiler to find a memory leak in your app only to find memory leak in the profiler itself. 😂

    • @jakearchibald
      @jakearchibald 3 роки тому +3

      haha not just the profiler, it was a leak in Safari in general!

  • @ehsankhorasani_
    @ehsankhorasani_ 3 роки тому

    Thank you very much. it was so much informative

  • @rajshekharmishra9151
    @rajshekharmishra9151 4 місяці тому

    Really interesting 👍

  • @wmhilton-old
    @wmhilton-old 3 роки тому

    Oh Safari

  • @BipinOli90
    @BipinOli90 2 роки тому

    Fantastic

  • @firiasu
    @firiasu 3 роки тому

    Nice subject!

  • @SaurabhKumar-ee6dj
    @SaurabhKumar-ee6dj 3 роки тому +1

    Is it possible to use ram for cache not my ssd

    • @jakearchibald
      @jakearchibald 3 роки тому +1

      --disk-cache-dir lets you change the location of the cache, and you could create a ramdisk for this if you wanted. I don't know what you're trying to gain from that, and I don't recommend it, but that's all I know.

    • @SaurabhKumar-ee6dj
      @SaurabhKumar-ee6dj 3 роки тому

      @@jakearchibald thank uou so much sir ❤

  •  3 роки тому +1

    15:55 😂

  • @PierreSoubourou
    @PierreSoubourou 3 роки тому

    excellent ! and quite readable even on smartphone ;-)

  • @mishasawangwan6652
    @mishasawangwan6652 3 роки тому

    safari is the new ie

  • @avi98717
    @avi98717 3 роки тому

    I didn't get what is unfoldable thing at 10:49 . Can some explain.

    • @jakearchibald
      @jakearchibald 3 роки тому

      The bit where is displayed? That's the JS console

  • @CyberAcidPlanet
    @CyberAcidPlanet 3 роки тому

    The big question is: do we have to remove listeners from elements that are going to be removed from DOM or are they automatially destroyed if the element is garbage collected after removal?

    • @GuskiS
      @GuskiS 3 роки тому

      DOM nodes always cleanup after themselves, meaning that listeners are removed/freed.
      However, working in a world of components, it is easy to forget to handle global listeners properly.
      In React it is generally done in useEffect callback function.

    • @SimonBuchanNz
      @SimonBuchanNz 3 роки тому

      Event emitters are pretty much literally just an array of listeners, so it's less "cleaning up after themselves" and more the GC just tosses the lot out at the same time.
      In practice the GC is just making things easier: you still have the basic problem of having to ensure that you have a protocol for ensuring things are cleaned up after they are no longer used (at least you don't have the problem of making sure they aren't cleaned up before they are used!)

  • @jimiscott
    @jimiscott 3 роки тому

    No more bedrooms!

    • @jakearchibald
      @jakearchibald 3 роки тому +3

      Hey, there was only ever one bedroom. Unless you think I sleep in my study? Which… I guess is believable.

    • @dassurma
      @dassurma 3 роки тому +5

      You just wait. I’ll demand that there’s a bed on our set!

  • @Manish-fm5iv
    @Manish-fm5iv 3 роки тому

    Interesting...

  • @delulu6969
    @delulu6969 3 роки тому

    Is window.matchMedia any more performant than window.onResize? Or it depends?

    • @jakearchibald
      @jakearchibald 3 роки тому

      Roughly the same in terms of performance I imagine. I went for matchMedia because it followed what we were doing in CSS

  • @ZMYaro
    @ZMYaro 3 роки тому

    May I ask what set-up you are using to control your slides with a Joy-Con? 👀

    • @jakearchibald
      @jakearchibald 3 роки тому

      It's just bluetooth, so it connects as a gamepad. Then we're using the gamepad API in the browser to pick up button presses.

    • @ZMYaro
      @ZMYaro 3 роки тому

      @@jakearchibald Oh, I didn't realize Joy-Cons map like regular gamepads-thanks!

  •  3 роки тому

    Am I the only one seeing the artifacts in the video?

    • @jakearchibald
      @jakearchibald 3 роки тому

      What kind of artifacts? What quality are you watching at?

  • @YOUTUBEACEHBERDIKARI
    @YOUTUBEACEHBERDIKARI 3 роки тому

    Hello,, salam kenal dari aceh

  • @cintron3d
    @cintron3d 3 роки тому

    First!

  • @GiovanniOrlandoi7
    @GiovanniOrlandoi7 2 роки тому

    Great video!