Allocators, Explained Simply

Поделиться
HTML-код
  • Опубликовано: 12 янв 2025

Комментарии • 90

  • @therealpancake7140
    @therealpancake7140 20 дней назад +49

    Super underrated channel for some reason. Came from the clay vid, stayed for the concise and visually pleasing explanations. Great watch

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +10

      Thanks, glad you enjoyed it! I really like making educational videos so it's great that people are getting some value out of them

  • @ciberman
    @ciberman 20 дней назад +72

    This video is sadly too short. I would happily watch an hour of you talking about allocators.

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +37

      We'll get there 😁 I'll make some more detailed videos on each of the different allocator types, this is more of a quick overview! Hopefully it gives folks enough of an intuition that if they go and read about different allocators on wikipedia or stack overflow, the concepts will make sense.

    • @maxrinehart4177
      @maxrinehart4177 18 дней назад +1

      "an hour"? say 2, 3 and even 4 contiguous hours. his method of explaining is clear and to the point.

    • @c3cris2
      @c3cris2 11 часов назад

      @@nicbarkeragainhe’s right

  • @TechJolt3d
    @TechJolt3d 20 дней назад +24

    I just found you yesterday, its cool to see a new vid. You are such a good teacher btw.

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +6

      Thank you, I really enjoy making these videos!

  • @avastmick
    @avastmick 20 дней назад +15

    Man, you should run your own CS course as you'd put the universities to shame. Keep it up please!

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +8

      You might have guessed something I have planned for the near future 😁

    • @ciberman
      @ciberman 18 дней назад

      If you do something more practical about implementation, please speak the algorithm in a more general way, not with a "let's code" approach. When you spend 8 hours daily reading code, you want to watch other videos that don't show explicit code, only new concepts or algorithms.

  • @deformercr6680
    @deformercr6680 18 дней назад +2

    I too came from the clay video, but im here for low level concepts explained clearly! Love your content, and your work, lots of respect ❤️

    • @nicbarkeragain
      @nicbarkeragain  18 дней назад

      Thanks so much! I hope I can help people see that low level programming isn't necessarily any more difficult or complicated than other approaches 😁

  • @helsontaveras7961
    @helsontaveras7961 20 дней назад +3

    Incredible storytelling, visuals, and passion! I can’t wait to learn more, and awesome new library BTW!

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +2

      So glad you enjoyed it! This video is one of many planned 😁

  • @Rope257
    @Rope257 13 дней назад

    Your videos are so good dude. I was literally thinking: "What about async then? How does that work?", when you went: "Just as a final tiny note..".
    Nice touch 😆👍

  • @ZipaNipa
    @ZipaNipa 13 дней назад +1

    Brilliant video once again! CS student from Finland here, Clay video made me find this channel and now you're stuck with me for life! Though I agree with many that I could have kept watching longer but I do think that 10-ish minute videos do best, and you do deserve more views! (And grouping multiple videos to playlists is always an option!)
    Just curious, what are you using to animate those allocator graphics? Cheers!

  • @hectormejia499
    @hectormejia499 20 дней назад +1

    keep them coming! this is becoming one of my favorite channels :D

  • @youssefelshabasy
    @youssefelshabasy 17 дней назад +1

    I don't know if you have any experience, but Ive been trying for a long time now to create a programming language, and Im stuck on backend codegen, either using LLVM or custom IR but I have no idea how to approach this as resources are scarce. You are really good at breaking things down, so it would be a blessing! Thanks for the amazing content.

  • @michaweglarz8791
    @michaweglarz8791 20 дней назад

    Such a great explanation! As someone with a high-level web development background learning about this, I find it incredibly useful and interesting. Thank you!

  • @AstrusHD
    @AstrusHD 20 дней назад +2

    Just got this recommended, happy to have found you, awesome video!

  • @skaruts
    @skaruts 20 дней назад +4

    This is great stuff. I've previously watched your video on arenas too. Memory management is something I struggle with a whole lot. I learned C some 15 years ago through a book, but I never learned anything about allocation strategies from it. Then I moved on to C++ (until I started hating it) and garbage collected languages (AS2, Haxe, Python, Lua, Nim), so, as crazy as it may sound, I never even knew allocators were a thing until I started using Odin recently. And then I find myself fighting memory leaks all the time (I'm using a tracking allocator to see them).
    I could be wrong, but I've watched many programming videos using C, and it seems to me that allocators is a subject that's been very widely neglected. (I don't like using C myself, but I find it interesting.)

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +5

      Believe me I totally understand where you're coming from. I did a computer science degree and was exposed to this kind of stuff, but it never really clicked for me until I built some projects that actually used the concepts. I can't how many of those "wait, this is actually simple" moments I've had over the years. I'm hoping I can short circuit some of the pain for others 🙂

    • @nikolabanovic4833
      @nikolabanovic4833 20 дней назад +1

      There was a move some 25 years ago, along with oop paradigm, that aimed to abstract any memory management away.
      This works fine until performamce issues hit (due to data being scattered around memory and pointer pointing to pointers pointing to pointers.... pointing to data).
      Then, many programmers not versed in how memory works under the hood, literally do not have an idea of what might be slowing the program down.
      As Eskil Steenberg said - initially all you want is convenience, eventually, all you want is control

  • @ManochonARG
    @ManochonARG 20 дней назад +1

    It’s a pleasure to hear you explain such interesting topics in such a simple and understandable way. This kind of content really motivates me to program.

    • @nicbarkeragain
      @nicbarkeragain  19 дней назад +1

      So glad to hear that! I try to explain things in the way I wish they had been explained to me 😅

    • @bsdooby
      @bsdooby 15 дней назад

      @nicbarkeragain Your preferred language (currently)?

  • @muream
    @muream 20 дней назад

    Oh, I'm super interested if you make more videos about Allocators!
    Recently started learning C and Odin and while I feel like I understand Allocators themselves, I struggle to know when and how to actually use them
    I also love how clearly you explain things, keep up the great work :)

  • @ggjkkit324
    @ggjkkit324 20 дней назад

    I must commend your approach at simplifying seemingly intricate subjects, and explaining them in ways that are quite easy to comprehend.

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +1

      Thanks! I think a lot of the topics around C and similar "low level" programming are prone to a bit of gate keeping and intimidation, whereas a lot of it is just very straightforward, logical and simple 🙂

    • @ggjkkit324
      @ggjkkit324 20 дней назад

      @nicbarkeragain I suppose that explains the "air of intricacy" surrounding C and Low-level programming paradigms and concepts.
      I genuinely look forward to more low-level programming contents from your channel.

  • @radadadadee
    @radadadadee 20 дней назад +15

    The government deallocating resources? Must be such a nice country to live in

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +9

      GREETINGS CITIZEN. PREPARE TO BE DEALLOCATED

    • @AGI-Bingo
      @AGI-Bingo 20 дней назад

      Oh no... 😂

  • @jorgegimenezperez9398
    @jorgegimenezperez9398 20 дней назад +13

    Votes here for an extended version

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +5

      Haha I will likely do several more videos on the actual implementation of a couple of allocators that I find very useful.

  • @HarshKumar-qw5ou
    @HarshKumar-qw5ou 20 дней назад

    Very good explanation, I would be happy to watch a longer more in depth version.

  • @ariefwt2220
    @ariefwt2220 20 дней назад +4

    Such an Underrated Channel, Especially that vector graphics animation. What software did you use to make them?

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад

      I make all my motion / vector graphics using the Canva video product 🙂

  • @AK-vx4dy
    @AK-vx4dy 19 дней назад +1

    Nicley explained, great work.

  • @godofpro5767
    @godofpro5767 20 дней назад +4

    i think a c tutorial series which implements these concepts or other videos regarding c would be great

  • @ahmedjaad4940
    @ahmedjaad4940 19 дней назад +1

    Great stuff, You've earned a subscriber

  • @jaysonbunnell8097
    @jaysonbunnell8097 13 дней назад +1

    as a zig enthusiast, i love to see allocators in the wild

    • @nicbarkeragain
      @nicbarkeragain  13 дней назад

      Zig is bringing a number of lower level concepts into the mainstream, I love it!

  • @Misterj05
    @Misterj05 19 дней назад +1

    I laughed out loud that Discord was requesting 5gb 🤣

  • @Daikuro1
    @Daikuro1 20 дней назад

    Armed with this knowledge, Al can never hide from us again.

  • @vittorioromeo1
    @vittorioromeo1 13 дней назад

    Fantastic introduction to the topic. What tool(s) do you use for your slides/animations?

  • @AliceErishech
    @AliceErishech 5 дней назад

    This actually reminds me of something tangential I learned about how Windows handles memory just the other day. I recently upgraded my computer, with the new build having 128GB of RAM. At that amount of memory, I figured I wouldn't really need a SWAP file anymore so I disabled it. (I have yet to use more than 32-34GB or so at any given time currently.) I use a Rainmeter skin to monitor various statistics about my system, this includes both RAM and SWAP. I noticed that it was, confusingly, reporting that I was using SWAP despite having no SWAP file anymore. After some searching, I learned about something that Microsoft calls Commit Charge. That name isn't really self-explanatory but basically, if a program asks for a chunk of memory but doesn't actually use all of it, the unused portion is tagged by Windows as Commit Charge which is classified as part of SWAP. From what I gather, the reason for this is that the Commit Charge memory is RAM that Windows will hand over to other programs if they request RAM and there's not enough free memory to give. It's classed as SWAP due to it not actually being actively used. It's confusing when you don't know about it and it's not the easiest thing to explain, but it does actually make sense.

    • @nicbarkeragain
      @nicbarkeragain  4 дня назад

      Thanks for the explanation! Most modern operating systems function in that same way - when you "allocate" memory, under the hood the operating system hands you over some small amount of real physical memory at the start of the allocation, and doesn't actually give you the rest of the amount until you actually access those memory pages. As a result, you can actually just allocate a large "fixed size" array with way more space than you will ever need, as an alternative to dynamic memory allocation 🙂 Although of course, if you have big peaks in your usage, your peak usage will never be reclaimed.

    • @AliceErishech
      @AliceErishech 4 дня назад

      @@nicbarkeragain It seems like a pretty logical way to handle things, really. Though Microsoft's term for it could definitely use some work, lol.

  • @pikuma
    @pikuma 19 дней назад +1

    Love your videos.

    • @nicbarkeragain
      @nicbarkeragain  19 дней назад

      Thank you Gustavo, you are an inspiration!

    • @maxrinehart4177
      @maxrinehart4177 18 дней назад

      both of you are an inspiration and i learned a lot from your videos

  • @LuisHenriqueON
    @LuisHenriqueON 20 дней назад

    Sir, thank you very much! Terrific!

  • @HowlingDeath
    @HowlingDeath 20 дней назад

    Awesome. Plss start series on game programming ❤

  • @odytrice
    @odytrice 20 дней назад +7

    Love your animations, what do you use to make them?

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +8

      I make all my motion graphics using Canva 🙂 It's pretty limited compared to after effects or motion, but it gets the job done for what I need. I used to work there so I kind of picked up all the tricks haha.

    • @odytrice
      @odytrice 20 дней назад +1

      @OMG, I use Canva all the time for thumbnails and in-video images. I had no idea you could use it for motion graphics. Great Tip, Thanks 🙏

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +2

      @@odytrice Yeah the video product is quite underrated. You can do slide transitions and pretty decent animations, then export at 4k60fps.

    • @AGI-Bingo
      @AGI-Bingo 20 дней назад

      ​@@nicbarkeragainthanks for the tip! Love canva 💜 and would love to see a canva style ClayDesigner sometime soon to quickly draw up and export clay ui to any platform (as mentioned in another comment)

  • @ElectricKitty
    @ElectricKitty 16 дней назад +2

    just two gb?

  • @KousseilaMd
    @KousseilaMd 2 дня назад

    amazing video, only thing wrong with it is that, the chrome in the video is too polite to be the real chrome. xD

  • @JohnSmith-w8r3r
    @JohnSmith-w8r3r 20 дней назад

    Good vidéo 👍
    keep the good work going !!

  • @ashfaqurrahman7334
    @ashfaqurrahman7334 19 дней назад

    awesome video

  • @notme9801
    @notme9801 18 дней назад +8

    See you later allocator

  • @Pedritox0953
    @Pedritox0953 20 дней назад

    Great video! Peace out

  • @BitPlease
    @BitPlease 20 дней назад

    Very good content

  • @RexSacriticulus
    @RexSacriticulus 17 дней назад

    Thank you, Willy Wonka, thank you for explaining alligators to me.

  • @cornjulio4033
    @cornjulio4033 20 дней назад +2

    Nice Channel, Weird Al !!

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +2

      My name is actually Daniel Radcliffe 😤

    • @cornjulio4033
      @cornjulio4033 20 дней назад +1

      haha, ok :D It was just a joke. Referring to bloke from the 90ies

    • @nicbarkeragain
      @nicbarkeragain  20 дней назад +2

      @@cornjulio4033 I was making a counter joke 😅 I actually love weird al, I listened to him all the time as a kid in the 90s, I memorized the lyrics to living with a hernia and like a surgeon! I was referencing the fact that Daniel Radcliffe plays Weird Al in the mockumentary / movie 🙂

  • @RealAXork
    @RealAXork 20 дней назад +2

    military getting only 10% is wild

    • @nicbarkeragain
      @nicbarkeragain  19 дней назад +2

      That was actually around what the USA was spending only a few years ago!

  • @brightshadow9480
    @brightshadow9480 20 дней назад +2

    I've found the Willy Wonka (Gene Wilder) of programming tutorials, "Come with me and you'll see a land of pure allocation ..."

    • @nicbarkeragain
      @nicbarkeragain  19 дней назад +2

      haha amazing. I'm a big fan of Gene Wilder btw. I think he was quite underrated. Blazing Saddles is an amazing movie

  • @bowser_inthe_darkworld2
    @bowser_inthe_darkworld2 17 дней назад +1

    incredible

  • @debanjanbarman7212
    @debanjanbarman7212 13 дней назад

    New sub

  • @danser_theplayer01
    @danser_theplayer01 20 дней назад

    In javascript async is implemented by adding a less prioritized stack called "the microtask queue".
    That way all immediate tasks not dependant on the async tasks are completed, then a microtask is run (will all the implied synchronous tasks like having a for loop inside an async function) and the next one and the next one. The runtime switches to another stack once the currently used one (sync stack or async queue) is completely empty, prioritizing the syncronous code.
    That's a very simplified general overview, I'm not an expert in runtimes. Don't know of any other solutions.

    • @nicbarkeragain
      @nicbarkeragain  19 дней назад

      The javascript event loop is actually a super cool idea IMO, I love interesting and strange core concepts in programming languages 😁

  • @BartKus
    @BartKus 20 дней назад

    5:40 in one place

  • @einzelltuter2847
    @einzelltuter2847 20 дней назад +4

    The analogy to the distribution of taxpayers' money is not well chosen. Or is your RAM secretly 'allocating' into it's "side-RAM"?

    • @julians.2597
      @julians.2597 20 дней назад +9

      Yes. Windows typically embezzles about 2GB of my ram.

  • @JorgetePanete
    @JorgetePanete 8 дней назад

    I think the voice and your camera are off-sync