How Garbage Collection Works

preview_player
Показать описание
This is a video about garbage collection, some information may be wrong or oversimplified. Leave your opinions and corrections below so that I can ignore them since reading comments stresses me out.

Please subscribe, as a human I have been conditioned to care about base 10 numbers and my brain will release happy chemicals when I reach the next one.

Some useful links:
Рекомендации по теме
Комментарии
Автор

I have been bamboozled, I thought I was gonna learn how solid waste management companies are created and run, and paid for by local governments and gated communities

RazaSyed
Автор

I like garbage collection because I'm garbage at coding

MyldFrnd
Автор

I think it heavily depends on discipline. There are C-code bases where even Valgrind and other analyzers can't protect you from leaking. But there are others where the lifetime model is thought through and you never have to worry about management. Game devs have memory management for games figured out at this point and found easy patterns for their use case. I wonder if, when web devs put their heads together, we also can find those patterns that make manual mem management easy.

addcoding
Автор

I want to know what my garbage collector is doing while I creep around my home and act like a goblin

ridass.
Автор

"you can choose to allocate and free heap memory yourself, but this usually increases the chance of a memory leak"

*GC users holding onto references and leaking a shit ton of memory because they refuse to learn how anything actually works

leonss
Автор

Not all strings are stored in the heap. In some languages like C++, there is "Short String Optimization", which puts the string into the string structure itself with a union, if it's short enough. That gets stored wherever the string object is stored, which can be in the stack.

C compiler will also put strings in the stack, if they are short enough

nordgaren
Автор

These days, GC is super advanced. ZGC, Java's newest garbage collector, attains constant-time sub-millisecond collection time, and very few pauses.

segganew
Автор

For char* get_name(), wouldn’t a copy of the pointer be passed out of the function, allowing name (which is a pointer to data, not data itself) to be deleted by the compiler? That way there’s still a reference to the result of read_user_input() which would be managed by the larger scope. I think that’s kinda what Swift does with reference counting

PreposterousPixel
Автор

Would you be willing to do a tutorial on how you make these modern and fancy animated videos?

Quantum_Nebula
Автор

1:23 r/AnarchyChess reference? btw I did see something like a chess move rating on the video about the best shell

LambdaCreates
Автор

Mixed mark and sweep, incremental and generational garbage collection?

revengerwizard
Автор

Could you possible make a video on how arena/linear allocation works?

somedudenamedanthony
Автор

0:39 this isn't true with all GCed languages; pony for example always runs the GC after a function terminates (unless you run it manually)

thezipcreator
Автор

amazing video, this taught me a lot about topic of this video

qcg_kzre
Автор

If you don't make garbage, you don't need a garbage collector! 😌

HamzaDeveloper-ju
Автор

Thanks for the video, learned a lot :)

tobzdaman
Автор

2:00 This is what I don't really understand and I was hoping you could explain it to me. If I return some pointer, I cannot free its heap on the end of its scope obviously, but why cannot simply the parent where this pointer is received at free it on its end of its lifecycle?

_modiX
Автор

“Big performance cost.” Things like this are over exaggerated.

truthastyle
Автор

interesting heap values 😅. props for no please subscribe, follow ytbers classic during the video

knkootbaoat