Garbage Collection Interview Questions and Answers in Java | With Live Demo | Code Decode

preview_player
Показать описание
In this video of code decode we have covered Garbage Collection Interview questions for experienced and fresher in Java

Udemy Course of Code Decode on Microservice k8s AWS CICD link:

Course Description Video :

Garbage collection in java is a very crucial and complicated interview topic. It hides many complexities within.

As an overview we can say that Garbage collection in java is an automatic process of looking at heap memory, identifying which objects are in use and which are not, and deleting the unused objects.

An in use object, or a referenced object, means that some part of your program still maintains a pointer to that object.

An unused object, or unreferenced object, is no longer referenced by any part of your program. So the memory used by an unreferenced object can be reclaimed.

Main Advantage of automatic garbage collection in java is that it removes the burden of manual memory allocation/deallocation from us so that we can focus on problem solving.

Area where we get this object manages is heap :
Whenever an object is created, it’s always stored in the Heap space and stack memory contains the reference to it. Stack memory only contains local primitive variables and reference variables to objects in heap space.

Thus All Java objects are always created on heap in java. EG
CustomeObj s1 = new CustomeObj ()

What are the different ways to make an object eligible for GC when it is no longer needed??
1) Set all available object references to null
2) Make the reference variable to refer to another object
3) Creating Islands of Isolation

In video we have seen live demo of all the three methods

What is the purpose of overriding finalize() method?

Its called by Garbage collector just before collecting any object which is eligible for GC.

Thus Finalize() method provides last chance to object to do cleanup and free any remaining resource

In video we have seen live demo of overriding Object class's finalize method so that we can implement our customization before garbage collection is called.

And many such java garbage collection interview questions are solved using live demo examples.
Heap memory and generation strategy is covered in next section

Garbage Collections Interview Questions part -2

-------------------------------------------------------------------------------------------------------------------------------------

Code Decode Playlists

-------------------------------------------------------------------------------------------------------------------------------------
Subscriber and Follow Code Decode

--------------------------------------------------------------------------------------------------------------------------------------

#garbageCollectionInterviewQuestions #codedecode #garbageCollectionJava
Рекомендации по теме
Комментарии
Автор

Mam, you are awesome and helping all learners and there is no lag. Point to point explanations..Gr8 and thankful to you

rangarajugottumukkala
Автор

It's masterpiece video to learn garbage collection in java

haresh
Автор

Your explanation is next level. Please continue with same courage, keep upload the videos mam. Tq :)

ravirajsaraganachari
Автор

perfect explanation!! I really feel happy about your channel's content and Iam pretty sure that when someone follows all your content, he/she can really crack any technical round on java.
Deep explanation which gets into us shows your skill.

srinivasacharya
Автор

Your videos are so helpful mam. Keep up the good work 👍

aakashgupta
Автор

🙏🙏🙏🙏 really really really thankful to you .🙏🙏🙏🙏

varunsharma
Автор

Ma'am awesome content.. waiting for multithreading and synchronisation, rmi topics

manognajoshik
Автор

Thanks mam for excellent video. By any chance we can avail all the ppts of your videos?

abhishekkulkarni
Автор

Awesome. Thanks for sharing knowledge 🙏

sanjeevkumarsah
Автор

Island of isolation is not clear.
Please upload a separate video.

shikhasrivastav
Автор

That was really a great explanation. Every video in this Java playlist is informative and helpful.Also could you please make a seperate video on island of isolation .
Also pls let us know if you would provide any paid trainings. I have tried to contact you in instagram..bt didn't get any response.
If any mail id to check about paid training.. definitely would be helpful
Thanks

alekyajaini
Автор

Great Explanation! 👌👌
Also after going through comments now I am also curious to know your name.🙂🙏

karishmarawat
Автор

Thanks mam for this video.very useful.
Pls do video for multithreading and concurrent exception concepts..

vinothkumarg
Автор

Great thanks! I will refer the video again.

mrrishiraj
Автор

Outstanding, Please upload the video for Multi-Threading asap.
If possible for Java8 also it will be a great help.

romiltiwari
Автор

Thanks for the nice explanation, would be helpful if you can also share the presentation.

vinodkumar-evuv
Автор

please make a video on Island of isolation .
Please make video on multithreading as well.

priyankakhamkar
Автор

Thank you ma'am, nice explanation : )

adityadalvi
Автор

Good day Mam.
Thanks for your videos, you are clearing many misunderstandings of the java framework.
Mam, can you please share some knowledge on garbage collection algorithms and their evolution ?
I recently got this question in an interview and was not able to answer.
I saw there are videos and blogs out there, but nobody has tell from scratch.
Can you please help in this sometime in near future ?

rohanseth
Автор

Please make video on tricky multi Threading interview questions

nikikinlekar