@kodekloud: Stack vs Heap, Finally Clear 🧠 Stack and heap share the same RAM, so why is stack faster? The stack tracks function calls with one pointer at the top. Each call adds a block with the return address, arguments and local variables, and it's wiped when the function returns. The heap holds data that must outlive the function, and an allocator has to find and track free space for it. That extra work is the slowdown. Stack overflow or memory leak, which one has bitten you? Comment below 👇 #StackVsHeap #MemoryManagement #Programming #ComputerScience #StackMemory #HeapMemory #StackOverflow #CodingTips #SoftwareEngineering #Linux #KodeKloud
It’s faster to read from heap than stack. Stack allocation is faster than heap allocation.
2026-09-25 18:55:23
18
Krzysztof Mazurek :
how do you do these animations?
2026-09-25 17:10:14
10
kele_038 :
Stack has O(1) constant time complexity, you just add and remove elements, there aint no way there is anything faster than that
2026-09-26 05:47:11
12
GrizzlyBeaver :
It works like that but there are some things that aren't exactly as exposed, for example: the Stack Pointer is where the stack's memory allocation is arrived, then functions are responsible for deallocating stack space: the stack itself does nothing, just moves up and down the Pointer after each allocation/deallocation
2026-09-26 13:56:20
2
user8181900021447 :
Wouldn’t you pass the text into draw page?
2026-09-26 21:08:00
1
Aidy :
The reason the stack is faster is because there is *no* memory allocation, the memory has already been allocated in one big block, you just put data into it at specific locations and use the stack pointer to track the end of the relevant data.
2026-09-26 11:55:07
11
bwk2008 :
You know how many senior developers don’t understand this
2026-09-25 18:13:58
3
Hina :
Wow keep it up bro
2026-09-26 08:53:04
1
Tít Trên Trời :
Yo, I have an OS test tmr. This found me
2026-09-26 03:25:59
3
Jason 'Loki' Smith :
first time in 17 years of C# programming that this is actually clicking for me. thank you my dude. such a simple explanation
2026-09-25 17:48:08
1
kpaka :
I have never regretted following you
2026-09-25 18:11:47
7
Justin Henry925 :
The stack has the queued list of functions, its not dependent on a nested recursive list of calls. When a function is invoked, its queued on the stack, and synchronously tackled 1 by 1. Its not last in last out like the video, its fifo. The only time that it seemingly becomes that is in nested calls like whats in the video. The example does not cover many cases. In many languages you can defer execution of parts of a function until later so that other functions can clear the stack before continuing
2026-09-26 01:22:15
0
someone_on_the_web1234 :
What Text to Speech do you use for these?
2026-09-25 21:55:06
0
Nguyễn Văn Thắng :
@Văn Tự
2026-09-27 13:14:59
1
Menas :
🥰🥰🥰
2026-09-26 00:00:45
0
To see more videos from user @kodekloud, please go to the Tikwm
homepage.