The main problem that I am seeing here is not the massive number of ClassNodes being generated, but rather that there are some massive ClassNodes. Raised
GROOVY-6184 to fix this in the compiler. Already fixed in greclipse 2.1.x, 2.0.x, and 1.8.x.
Problem is that ClassHelper instantiates Enum and Annotation differently from all other ClassNodes. They are lazily initialized, whereas all other class nodes are generated directly from Class objects. This was because historically, groovy had to handle Java 1.4 as well as 1.5. 1.4 support has been dropped, so this distinction is no longer relevant.
Problem is that in greclipse, the first time that an enum or annotation type is declared in source, these ClassNodes in ClassHelper are resolved. They are resolved against the current project and remain fixed that way no matter what happens, even if that project is subsequently deleted from the workspace. This is the cause of the memory leak that I discovered earlier.
This problem also happens in the standalone compiler, but the affects are much less bad.