Is it possible to have memory leaks in languages that has Garbage Collector? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 20

Is it possible to have memory leaks in languages that has Garbage Collector?

When I develop C programs, sometimes "memory management" get so much energy from me that I lose concentration from the main problem. Do I still have to worry about memory management in languages with Garbage Collector? Is it possible to have memory leaks in them?

9th Jun 2018, 8:55 PM
Amir
Amir - avatar
4 Answers
+ 5
you don‘t really have to worry about memory management most of the time(of course there are always some rare exceptions) but you could get a memory leak if the garbage collector is buggy also look at this thread: https://stackoverflow.com/questions/10577534/can-you-have-memory-leaks-with-a-garbage-collector
9th Jun 2018, 9:33 PM
Max
Max - avatar
+ 2
Small ones, nothing serious. I suggest you to try C++, it does just some of the garbage collection for you, but without runtime overhead.
11th Jun 2018, 10:18 AM
Timon Paßlick
+ 2
No
5th Aug 2019, 12:28 AM
Sonic
Sonic - avatar
+ 1
Circular references can be a problem even with garbage collected languages, but generally with GC you don't have to worry about memory management.
15th Mar 2019, 11:25 AM
Aleksi
Aleksi - avatar