3 ms·
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
by daemin 10y ago
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.