Creating a memory leak with Java

Actually, there are many ways to create a memory leak with Java.

Currently, I suppose there are two mainly thinking methods.

1:

Creating many long-running threads (maybe using ThreadPool)

The Thread loads a class via ClassLoader

The class allocate a large chunk  of memory, store a strong reference to its static field

Class Leak is a common memory leak problem and it usually depends on the JVM

2:

create listeners and do nothing

the listener will cause leak

Here is a link to this question:

http://stackoverflow.com/questions/4948529/easiest-way-to-cause-memory-leak-in-java?lq=1