Тёмный

Memory Leaks in Java | Issues Caused and How to Prevent | Example 

Lazy Programmer
Подписаться 4,9 тыс.
Просмотров 23 тыс.
50% 1

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

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 56   
@nidhi10sharma
@nidhi10sharma Год назад
Excellent explanation. Thank you very much!
@LazzyProgrammer
@LazzyProgrammer Год назад
Thank you for the feedback :)
@vjdreamworks2256
@vjdreamworks2256 10 месяцев назад
Well explained. Thanks for your efforts 🙏
@LazzyProgrammer
@LazzyProgrammer 10 месяцев назад
Thank you for your valuable feedback 🙏
@saddammd
@saddammd 2 года назад
I thought these topics are only theoretical definition and it can't be visualised. Thanks for sharing your valuable knowledge.
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you, I am glad that it was helpful...
@RanjitKumar-kb7zt
@RanjitKumar-kb7zt Год назад
Finally, I got to know after many years of experience. Thanks!!!
@LazzyProgrammer
@LazzyProgrammer Год назад
I am glad that I was helpful 🙂
@maankhurana5814
@maankhurana5814 2 месяца назад
Got to learn new thing todays ... Thanks buddy
@LazzyProgrammer
@LazzyProgrammer 2 месяца назад
I am glad 😊 Let's keep learning
@nikunjpatel8314
@nikunjpatel8314 2 года назад
Excellent explanation with visualization. Very nice tutorial 👌 👍
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you Nikunj 😊
@JorgetePanete
@JorgetePanete Год назад
Correction: in java 9+, do not avoid string concatenation if the whole string is computed on a single operation (i.e. not in a loop), the compiler and runtime know enough for it to be optimal
@bharathkl5229
@bharathkl5229 6 месяцев назад
I learned a lot , thank you ❤
@utkarshvanjale749
@utkarshvanjale749 2 года назад
Really helpful please come up such interesting knowledgeable videos
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you Utkarsh for your valuable feedback 🙂
@teeh6189
@teeh6189 2 года назад
Great video with easy to understand explanation. I have a question. I checked my hprof heap dump as I thought my application was causing memory leaks, but it turns out most of the memory is consumed by byte, char and Strings which are not from my application. How do I fix or avoid memory leaks in that case? Your response will be highly appreciated. Thanks
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you for your support and feedback 😊 For the issue which you are currently facing. As there is no user defined classes which are causing the issue. You need to check the over usage of Strings in your application. Are you doing a lot of String manipulation? In such cases you may need to use StringBuilder/StringBuffer depending on the nature of your application (Single Threaded/Multi Threaded). Also, look for the connection objects and buffers, they must be closed after use. I will recommend to use try-with-resources if you are using Java 1.7 and above.
@peterg76yt
@peterg76yt 10 месяцев назад
A static field, by itself, is not a memory leak. It's only a memory leak if memory is allocated but not released when no longer needed. If you need a list of doubles for the lifetime of the program, then keeping the data in a static field is an appropriate design. If at some point in the program execution they are no longer needed, just call List::clear.
@LazzyProgrammer
@LazzyProgrammer 10 месяцев назад
Correct, it's about how we use it
@MrNareshProMax
@MrNareshProMax Год назад
thanks for sharing the knowledge in such a simple way. You are genious. Keep uploading such useful stuff.
@LazzyProgrammer
@LazzyProgrammer Год назад
Thank you, I am glad that it was helpful 🙂
@syamnaidu5244
@syamnaidu5244 Год назад
Worth watching the video. Thank you ^_^.
@LazzyProgrammer
@LazzyProgrammer Год назад
Glad you enjoyed it!
@realknowledge-23
@realknowledge-23 3 месяца назад
very good content thanks a lot and all the very best.
@LazzyProgrammer
@LazzyProgrammer 3 месяца назад
Thank you so much Ashok :)
@pravinjain2834
@pravinjain2834 Год назад
Why the populate method is not declared static, since it is only using static member? In that case to populate the list we will not need to create the object of the class. And when the list is no longer needed then it could be set to null, to let the garbage collector reclain it. It would not need the unloading of the class in such a case.
@LazzyProgrammer
@LazzyProgrammer Год назад
Yes you can do it that way also, there should not be any issue. But to test the non static list anyway you have to make the populate method as non static.
@pravinjain2834
@pravinjain2834 Год назад
@@LazzyProgrammer Agreed, The idea is that whereever a method can be written as static(not dependent on instance), it should be declared static and invoked without using an instance.
@Rajesh-qk1ne
@Rajesh-qk1ne 2 года назад
Easy to understand.... Very good explanation sir 👍👍
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you 😊
@kishordige9721
@kishordige9721 Год назад
Was helful
@DurgaShiva7574
@DurgaShiva7574 Год назад
one of the best videos which i have came across till date.. please keep up this good work!!
@LazzyProgrammer
@LazzyProgrammer Год назад
Thank you so much for your feedback 😊 Let's Keep Learning Together !!!!
@sarafarazahmadmomin1665
@sarafarazahmadmomin1665 4 месяца назад
Explain with perfect example
@LazzyProgrammer
@LazzyProgrammer 4 месяца назад
Thank you 🙏
@dptech79
@dptech79 2 года назад
Great explaination and it's very helpful
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you Durga I am glad it was helpful...
@AmNotLegend
@AmNotLegend Год назад
how to run it from a MAC os
@LazzyProgrammer
@LazzyProgrammer Год назад
Hello Yichun, You can download and install .dmg from visual vm's website for running it on Mac.
@pronavsandhu
@pronavsandhu Год назад
very informative video on an underrated topic. thank you !!
@LazzyProgrammer
@LazzyProgrammer Год назад
Thank you for your feedback 🙂 Please do share the videos you like with your community as well. Let's share the knowledge.
@pronavsandhu
@pronavsandhu Год назад
@@LazzyProgrammer sure
@rocastone1349
@rocastone1349 2 года назад
super cool!!!
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you 😊
@SohailKhan-pu2oi
@SohailKhan-pu2oi 2 года назад
Great Sir! keep sharing such awesome tutorials.
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you Sohail 🙂
@clarencedonovan231
@clarencedonovan231 Год назад
Amazing. Thank you so much.
@LazzyProgrammer
@LazzyProgrammer Год назад
I am glad that it was helpful 🙂
@poonamjadhao4990
@poonamjadhao4990 2 года назад
Nicely explain. Very useful.
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you Poonam, I am glad that it was useful...
@Rudar263
@Rudar263 2 года назад
Awesome
@LazzyProgrammer
@LazzyProgrammer 2 года назад
Thank you Nand Kishor 🙂
@JorgetePanete
@JorgetePanete Год назад
Soon to be a correction: the finally block is most of the time replaced by the try-with-resources, and the finally block will be removed in some future java release
@nupurgulati9433
@nupurgulati9433 2 года назад
This is very useful 👍
@LazzyProgrammer
@LazzyProgrammer 2 года назад
I am glad it was useful. Thanks for sharing your valuable feedback 😊
Далее
Java Memory Model in 10 minutes
10:55
Просмотров 261 тыс.
Qalpoq - Amakivachcha (hajviy ko'rsatuv)
41:44
Просмотров 312 тыс.
ПОЮ ВЖИВУЮ🎙
3:19:12
Просмотров 879 тыс.
Troubleshooting Memory Problems in Java Applications
42:37
Only The Best Developers Understand How This Works
18:32
Solving Java Memory Leaks
45:06
Просмотров 33 тыс.
The Java Memory Model - The Basics
23:41
Просмотров 128 тыс.
Qalpoq - Amakivachcha (hajviy ko'rsatuv)
41:44
Просмотров 312 тыс.