9. Java Memory Management and Garbage Collection in Depth

preview_player
Показать описание
➡️ Notes link: Shared in the Member Community Post (If you are Member of this channel, then pls check the Member community post, i have shared the Notes link there)

➡️ Join this channel to get access to member only perks:

Topics which i have covered:

- Type of Memory (Stack and Heap)
- What kind of data is Stored in Stack and Heap with Example
- Types of References
- Strong Reference
- Weak Reference
- Soft Reference
- Heap Memory Structure
- Young Generation
- Eden
- Survivor (S0 and S1)
- Old Generation
- Metaspace
- How Garbage Collector work & clean up the Heap memory with Example
- Types of Garbage Collector
- Single GC
- Parallel GC
- CMS (Concurrent Mark and Sweep)
- G1 GC

Chapters:
00:00 - Introduction
01:23 - What kind of Data is stored in Stack and Heap
04:52 - Stack and Heap understanding with Example
18:32 - Different types of Reference (Strong, Weak & Soft)
27:14 - Heap Memory Structure Explanation with Example
40:35 - Garbage Collection Algorithm and Types

#java #interview #softwareengineer
Рекомендации по теме
Комментарии
Автор

This is by far the best explanation I've come across on Memory Management. So detailed yet so easy to understand. Thank you so much🙏

siddhantpardeshi
Автор

Very detailed explanation. Love how you dont skip even a minor topic so anyone who's missed a previous video still gets the context.

PranjaliKhule-iw
Автор

not too simple; not too complicated; right way of explaining the most complicated topic; this is good enough for java application developer. you could write a simple Java application; runtime, provide a minimum memory; create a while(true) loop and create several objects; crash the JVM. then you could add random objects set null for garbage collection. also create weak and soft references; observe null pointer exception.

californiaBala
Автор

bhai have nothing to say . just one lector you will clear any interview related to JVM/Heap/GC . Thanks a lot. Just subscribed

manojrana
Автор

Hi Shreyansh,
I have a doubt, you told during Mark & Sweep with Compaction that the objects will get stored in sequential order after gc works but won't that be everytime as the surviving objects are put into Survivor space? So, why would it put in random memory locations in the first place, it should be sequential for any kind of mark & sweep, right?

WealthyManiacOG
Автор

Awesome video man. Just to point out one trivial thing, in Mark phase of Mark & Sweep, it marks all the referenced nodes( not the unreferenced ones) from the root( active thread, or any static variable) and subsequently in sweep phase the unmarked ones get deleted, just like having only one connected component from the root.

PrjBh
Автор

Was searching since morning for best videos of memory management and types of gc and now i can say this is the bestest video i got today...so easy and clear explanation ❤

altamashalishaikh
Автор

Hi Shreyansh,
A quick doubt here, you were explaining about Mark & Sweep with compact algorithm right. You said that once the algo finds that the memory used to store objects in not sequential then it will make the objects store in sequential order right? My question is will the reference name change in that case, what I mean is if you try to print the object without having toString() then it will print @sdf23 will this change?

Placement-bvcg
Автор

Hey, where did you get all this knowledge from: books or working in corporate?

Do_ItForAnime
Автор

Hi Shreyansh Jain At 33:48 i have one doubt when mark & sweep ran second time why it put obj6 directly into S1 and Why not S0 . Can you please explain

KishoreThatavarthi
Автор

The best video I found so far on memory management. 🎉

MOHAMMADBILAL-hzfq
Автор

a staff engineer for a reason! bro! kudos to this and really well documented and oriented video! Thanks! Good luck! best wishes

CriticalInsightsRealizations
Автор

Nice explanation. It's really pretty much informative content which is helpful to understand memory related behavior of your application during load test. Thank you so much for such detailed explanation.

kanikadeka
Автор

Perfect explanation by our beloved "Mr. Perfect bhayiya"😊😊😊

saurabhtiwari
Автор

Bro
Thanks a lot
Best & best explanation
Even a non programmer can understand 👌

ganeshreddy
Автор

In mark, sweep and compact algo, u r referring to memory blocks inside eden, s0, s1 ? or as a whole in the heap..?

TheOne-cyyu
Автор

Best explanation I have ever seen for Memory Management

vijaymaradkar
Автор

FYI, Weak reference can be useful when implementing caching, as it is something we can afford to loose, and by nature, is designed to be refreshed.

SomjitNag
Автор

i got a doubt that as per the video you mentioned that threshold age 3 whenever the surveyor objects reaches age 3 it promotes to old gen, what if we haven't provided anything threshold value then what is default age by JVM. Thanks advance

GarlapatiAyyappaLokesh
Автор

Learnt so many new things today!
I will flaunt these knowledge in my upcoming interview as an fresher :)

siddhantprakash.