I'm a hiring manager and when I see a resume with a few years of Java I ask the same question.
It's all about objects being "unintentionally reachable" which generally all boils down to putting something in a collection and never taking it out, or completely forgetting about object lifecycle. Just because you have a runtime and a GC doesn't mean you can forget any kind of teardown.
(If you register an event listner and never unregister you are ignoring lifecycle.)
People who have a few years of Java on their resume should have some idea of when an object is eligible for collection by the GC and the common programmer errors shown by other posts in this thread that can cause leaks.
That's the classic example of a memory leak in a GC language. Where you add objects to some list or map so that they can be looked up quicker than being created again. Some people call it a cache. What people forget though is some way of removing the items from the cache, and so it leaks these objects for the lifetime of the application.
Not really as sophisticated as other ways of leaking memory, but it can also be easily done in all other languages.
It's all about objects being "unintentionally reachable" which generally all boils down to putting something in a collection and never taking it out, or completely forgetting about object lifecycle. Just because you have a runtime and a GC doesn't mean you can forget any kind of teardown. (If you register an event listner and never unregister you are ignoring lifecycle.)
People who have a few years of Java on their resume should have some idea of when an object is eligible for collection by the GC and the common programmer errors shown by other posts in this thread that can cause leaks.