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.
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.
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 😆👍
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!
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.
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!
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.)
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 🙂
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
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.
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 :)
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 🙂
@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.
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.
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.
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.
@@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)
@@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 🙂
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.
Super underrated channel for some reason. Came from the clay vid, stayed for the concise and visually pleasing explanations. Great watch
Thanks, glad you enjoyed it! I really like making educational videos so it's great that people are getting some value out of them
This video is sadly too short. I would happily watch an hour of you talking about allocators.
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.
"an hour"? say 2, 3 and even 4 contiguous hours. his method of explaining is clear and to the point.
@@nicbarkeragainhe’s right
I just found you yesterday, its cool to see a new vid. You are such a good teacher btw.
Thank you, I really enjoy making these videos!
Man, you should run your own CS course as you'd put the universities to shame. Keep it up please!
You might have guessed something I have planned for the near future 😁
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.
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 ❤️
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 😁
Incredible storytelling, visuals, and passion! I can’t wait to learn more, and awesome new library BTW!
So glad you enjoyed it! This video is one of many planned 😁
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 😆👍
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!
keep them coming! this is becoming one of my favorite channels :D
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.
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!
Just got this recommended, happy to have found you, awesome video!
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.)
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 🙂
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
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.
So glad to hear that! I try to explain things in the way I wish they had been explained to me 😅
@nicbarkeragain Your preferred language (currently)?
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 :)
I must commend your approach at simplifying seemingly intricate subjects, and explaining them in ways that are quite easy to comprehend.
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 🙂
@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.
The government deallocating resources? Must be such a nice country to live in
GREETINGS CITIZEN. PREPARE TO BE DEALLOCATED
Oh no... 😂
Votes here for an extended version
Haha I will likely do several more videos on the actual implementation of a couple of allocators that I find very useful.
Very good explanation, I would be happy to watch a longer more in depth version.
Such an Underrated Channel, Especially that vector graphics animation. What software did you use to make them?
I make all my motion / vector graphics using the Canva video product 🙂
Nicley explained, great work.
Thanks, I appreciate that!
i think a c tutorial series which implements these concepts or other videos regarding c would be great
That is a fantastic idea!
Great stuff, You've earned a subscriber
Thank you, glad you enjoyed it!
as a zig enthusiast, i love to see allocators in the wild
Zig is bringing a number of lower level concepts into the mainstream, I love it!
I laughed out loud that Discord was requesting 5gb 🤣
Armed with this knowledge, Al can never hide from us again.
Fantastic introduction to the topic. What tool(s) do you use for your slides/animations?
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.
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.
@@nicbarkeragain It seems like a pretty logical way to handle things, really. Though Microsoft's term for it could definitely use some work, lol.
Love your videos.
Thank you Gustavo, you are an inspiration!
both of you are an inspiration and i learned a lot from your videos
Sir, thank you very much! Terrific!
Awesome. Plss start series on game programming ❤
Love your animations, what do you use to make them?
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.
@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 🙏
@@odytrice Yeah the video product is quite underrated. You can do slide transitions and pretty decent animations, then export at 4k60fps.
@@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)
just two gb?
amazing video, only thing wrong with it is that, the chrome in the video is too polite to be the real chrome. xD
Good vidéo 👍
keep the good work going !!
awesome video
See you later allocator
🐊
Great video! Peace out
Very good content
Thanks, great you enjoyed it!
Thank you, Willy Wonka, thank you for explaining alligators to me.
Nice Channel, Weird Al !!
My name is actually Daniel Radcliffe 😤
haha, ok :D It was just a joke. Referring to bloke from the 90ies
@@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 🙂
military getting only 10% is wild
That was actually around what the USA was spending only a few years ago!
I've found the Willy Wonka (Gene Wilder) of programming tutorials, "Come with me and you'll see a land of pure allocation ..."
haha amazing. I'm a big fan of Gene Wilder btw. I think he was quite underrated. Blazing Saddles is an amazing movie
incredible
Thanks!
New sub
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.
The javascript event loop is actually a super cool idea IMO, I love interesting and strange core concepts in programming languages 😁
5:40 in one place
The analogy to the distribution of taxpayers' money is not well chosen. Or is your RAM secretly 'allocating' into it's "side-RAM"?
Yes. Windows typically embezzles about 2GB of my ram.
I think the voice and your camera are off-sync