Тёмный

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

Code Decode
Подписаться 137 тыс.
Просмотров 96 тыс.
50% 1

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:
openinapp.co/u...
Course Description Video :
yt.openinapp.c...
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?
Finalize method in Java also called finalizer is a method defined in java.lang.Object
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
• Garbage Collection Int...
-------------------------------------------------------------------------------------------------------------------------------------
Code Decode Playlists
Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
Advance Java Interview Questions and Answers : • Advance Java Interview...
Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
Spring Boot Interview Questions and Answers : • Advance Java Interview...
Angular Playlist : • Angular Course Introdu...
GIT : • GIT
-------------------------------------------------------------------------------------------------------------------------------------
Subscriber and Follow Code Decode
Subscriber Code Decode : www.youtube.co...
Linkedin : / codedecodeyoutube
Instagram : / codedecode25
--------------------------------------------------------------------------------------------------------------------------------------
#garbageCollectionInterviewQuestions #codedecode #garbageCollectionJava

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 85   
@srinivasacharya4695
@srinivasacharya4695 3 года назад
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.
@CodeDecode
@CodeDecode 3 года назад
Thanks srinivas for writing back to us. We are glad that we are able to help. Thanks for the motivation, keep learning keep growing
@shikhasrivastav9208
@shikhasrivastav9208 3 года назад
Island of isolation is not clear. Please upload a separate video.
@CodeDecode
@CodeDecode 3 года назад
Sure will create seperate video on this too
@srinivasyadav9925
@srinivasyadav9925 2 года назад
If finalize method is called before system.gc is called then why main method is called printed it should print finalize method is called right?
@giantbush4258
@giantbush4258 8 месяцев назад
No offense but please stop says nothing but.
@CodeDecode
@CodeDecode 8 месяцев назад
Sure 😊😊
@dhanunjaya_07
@dhanunjaya_07 Год назад
Please create a new video for islands of isolation
@CodeDecode
@CodeDecode Год назад
Sure we will create it soon
@abhishekkulkarni3466
@abhishekkulkarni3466 2 года назад
Thanks mam for excellent video. By any chance we can avail all the ppts of your videos?
@vigneshgandhi8684
@vigneshgandhi8684 18 дней назад
Hello That is a perfect and great explanation If possible can we get the PPT from which you are teaching for revision it will be very very helpful
@tusharpatil2749
@tusharpatil2749 3 года назад
What is the use case of creating isolation? If we want our objects as garbage collected, then we can directly make two object as null. Why there is need of isolation.
@rohanseth6632
@rohanseth6632 3 года назад
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 ?
@CodeDecode
@CodeDecode 3 года назад
Sure. That's a very nice topic. Will surely put a video on that. Thanks 👍👍
@ravirajsaraganachari3038
@ravirajsaraganachari3038 3 года назад
Your explanation is next level. Please continue with same courage, keep upload the videos mam. Tq :)
@CodeDecode
@CodeDecode 3 года назад
Thanks for the nice words 👍
@kidschannel3090
@kidschannel3090 2 года назад
Explaination is nothing but Awesome 💞
@CodeDecode
@CodeDecode 2 года назад
Thanks
@vasanthabhanu8191
@vasanthabhanu8191 3 года назад
How many years of experience you have?
@techkid358
@techkid358 2 месяца назад
how to explain islands of isolation in interview ?
@nikikinlekar6968
@nikikinlekar6968 3 года назад
Please make video on tricky multi Threading interview questions
@CodeDecode
@CodeDecode 3 года назад
Sure will create on that soon
@alekyajaini3749
@alekyajaini3749 2 месяца назад
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
@karishmarawat1359
@karishmarawat1359 3 года назад
Great Explanation! 👌👌 Also after going through comments now I am also curious to know your name.🙂🙏
@CodeDecode
@CodeDecode 3 года назад
Thanks Karishma. We will reveal that soon 🙃🙏
@start1learn-n171
@start1learn-n171 7 месяцев назад
Tq
@CodeDecode
@CodeDecode 7 месяцев назад
Welcome
@pareshpatil8679
@pareshpatil8679 Год назад
in Island of isolation --> why did you not directly pointe the refernce to null , why did you use instance reference variable and then alterd the poniting .. and then set to null ...?? what was logic behind this much Traverse ??????
@BobanPRaj
@BobanPRaj 3 года назад
Good video thanks. But one doubt: the finalize is called after the main method is done, which means the gc we called didn't reclaimed the memory of that object right? The reclaim is dne automatically once the scope of that object is gone right?
@CodeDecode
@CodeDecode 3 года назад
If set explicitly to null then memory will not have any reference left then it will be any how garbage collected. Else Yes whenever scope of variables ends it's eligible for garbage collection
@urnotSylvia
@urnotSylvia Год назад
Hi mam, thanks for the video. But what's the difference in result between doing the steps of creating island of isolation and point the references directly to null? Thanks.
@gayatrideshpande5456
@gayatrideshpande5456 8 месяцев назад
I am having same doubt. Didn't get clear idea of island of isolation
@priyankakhamkar1112
@priyankakhamkar1112 3 года назад
please make a video on Island of isolation . Please make video on multithreading as well.
@CodeDecode
@CodeDecode 3 года назад
Will do that soon 👍
@DineshSharma-xi1lq
@DineshSharma-xi1lq Год назад
But what is the use of island of isolation?
@dhirajsumatkar725
@dhirajsumatkar725 Год назад
Mam please share this PPT.
@vinothkumarg7731
@vinothkumarg7731 3 года назад
Thanks mam for this video.very useful. Pls do video for multithreading and concurrent exception concepts..
@CodeDecode
@CodeDecode 3 года назад
Sure will create a video on threads too
@manognajoshik8465
@manognajoshik8465 2 года назад
Ma'am awesome content.. waiting for multithreading and synchronisation, rmi topics
@CodeDecode
@CodeDecode 2 года назад
Sure Manogna we will upload soon 👍🙂
@nageshnikavade7712
@nageshnikavade7712 9 месяцев назад
@CodeDecode team Thanks for such a nice explanation, and if possible where we can get the PPT that you used
@vinodkumar-ev6uv
@vinodkumar-ev6uv 3 года назад
Thanks for the nice explanation, would be helpful if you can also share the presentation.
@rajsaraogi
@rajsaraogi Год назад
If suppose i initalize a object inside a local function and the function call completes will my object created locally be garbage collected automatically?
@romiltiwari2643
@romiltiwari2643 3 года назад
Outstanding , Please upload the video for Multi-Threading asap. If possible for Java8 also it will be a great help.
@CodeDecode
@CodeDecode 3 года назад
Sure m planning to upload them soon
@haresh4063
@haresh4063 Год назад
It's masterpiece video to learn garbage collection in java
@CodeDecode
@CodeDecode Год назад
Thanks for the nice words
@varunsharma0099
@varunsharma0099 2 года назад
🙏🙏🙏🙏 really really really thankful to you .🙏🙏🙏🙏
@CodeDecode
@CodeDecode 2 года назад
🙂👍 Thanks Varun
@rohitahirwar125
@rohitahirwar125 Год назад
GC k through object bhi delete hojata h kya ? ya phir bas usne jo memory bannyi h vo bas?
@aakashgupta7211
@aakashgupta7211 2 года назад
Your videos are so helpful mam. Keep up the good work 👍
@CodeDecode
@CodeDecode 2 года назад
Thanks Aakash 🙂👍
@rangarajugottumukkala9380
@rangarajugottumukkala9380 2 года назад
Mam, you are awesome and helping all learners and there is no lag. Point to point explanations..Gr8 and thankful to you
@CodeDecode
@CodeDecode 2 года назад
Thanks a lot 🙂🙂👍👍
@nandinibagga4857
@nandinibagga4857 3 года назад
awesome awesome awesome
@CodeDecode
@CodeDecode 3 года назад
Thanks Nandini....
@sreejak6776
@sreejak6776 2 года назад
Hi mam, there is a little confusion in the last point that you have mentioned.Should all the foreground threads stop for the background thread to stop running or is it vice-versa? The statement which you told seems little contradactory.Could you pls explain it. Thanks!!
@CodeDecode
@CodeDecode 2 года назад
When all foreground threads stops, all background threads created will be terminated. Example is explained in these videos ru-vid.com/group/PLyHJZXNdCXsdUXzeeBZIADof_U-40jBJO
@vasuc4190
@vasuc4190 3 года назад
Explain healthcare project for inteview purpose
@manojpandey6661
@manojpandey6661 3 года назад
Thanks for this video. It would be helpful if you please cover heap part i.e young gen ,old gen and parm gen in detail in part 2 of this video.
@CodeDecode
@CodeDecode 3 года назад
Ok. Will upload part 2 soon then
@sanjeevkumarsah4047
@sanjeevkumarsah4047 2 года назад
Awesome. Thanks for sharing knowledge 🙏
@CodeDecode
@CodeDecode 2 года назад
you're welcome Sanjeev
@rajeshprince758
@rajeshprince758 3 года назад
Pls upload maltitherad .. interview questions
@CodeDecode
@CodeDecode 3 года назад
Sure will create video on multi threading too soon
@rajeshprince758
@rajeshprince758 3 года назад
@@CodeDecode pls upload spring questions too
@adityadalvi7884
@adityadalvi7884 3 года назад
Thank you ma'am , nice explanation : )
@CodeDecode
@CodeDecode 3 года назад
Thanks Aditya 👍👍
@sanjushekhawat6446
@sanjushekhawat6446 3 года назад
Thanks a lot my all concept clear plz keep it
@CodeDecode
@CodeDecode 3 года назад
we are glad we were able to clear your concepts. Please let us know if you have any queries
@mehulchauhan6947
@mehulchauhan6947 3 года назад
Thanks for making it so easy to understand.
@CodeDecode
@CodeDecode 3 года назад
👍👍🙂🙂
@shubhamasthana191
@shubhamasthana191 3 года назад
great explanation thank u so much🙏
@CodeDecode
@CodeDecode 3 года назад
Your welcome 👍
@mohitbang5556
@mohitbang5556 3 года назад
Doing good job... Keep it up...!!
@CodeDecode
@CodeDecode 3 года назад
Thanks for the nice words 👍
@mrrishiraj88
@mrrishiraj88 9 месяцев назад
Great thanks! I will refer the video again.
@CodeDecode
@CodeDecode 9 месяцев назад
Thanks
@ruwan2471
@ruwan2471 3 года назад
Thank you so much !!!
@CodeDecode
@CodeDecode 3 года назад
👍
@saiprakash1125
@saiprakash1125 3 года назад
Great video 👌
@CodeDecode
@CodeDecode 3 года назад
Thanks
@sahuamit30
@sahuamit30 3 года назад
You are awesome 👏
@CodeDecode
@CodeDecode 3 года назад
Thanks Amit 👍👍
@sahuamit30
@sahuamit30 3 года назад
@@CodeDecode may I know ur name please Mam Do u give any paid training sessions
Далее
When Goalkeepers Get Bored 🤯 #3
00:27
Просмотров 1,1 млн
OYUNCAK DİREKSİYON İLE ARABAYI SÜRDÜ 😱
00:16
When Goalkeepers Get Bored 🤯 #3
00:27
Просмотров 1,1 млн