grails/grails-core — pull request #362 by nobeans (2013-06-19 10:01:51+00:00)
Title: Forked Mode: fixed the problem of becoming slow gradually for test execution

It's caused by deeply nested context class loaders which is created for each execution.
To fix it, I think there are two strategy (and more):

(a) To create and set new class loader always using systemClassLoader as parent loader
=> You should fix all locations where classLoader is instantiated. and this needs your attention in future.

(b) To create and set new class loader only if it needs
=> don't care the nested level. but the times of creating and setting is a few, so it wouldn't be problem.

I've tried to fix it by (b). the fixing code is very simple.