The memory leak is a situation where programmer undeliberately keep some objects in memory but not aware of, usually by poor implementation of object destructors. The repercussion of such is that some memory is never released and can be seen as memory consumption build up with no reasonable explanation. The above example is not such. The languages with garbage collectors are less exposed to memory leaks in a general sense. If you keep a reference to some object is something you do on purpose. To be truly onset the garbage collector is also o piece of code written by humans ;-).