[stringtemplate-interest] it's 60% of time in ObjectModelAdaptor.getProperty()

Johan Stuyts j.stuyts at javathinker.com
Sun Feb 6 07:32:17 PST 2011


> Another problem with compiling to bytecode is that for each
> compilation you have a new class lurking around. You can still reuse
> them, but getting rid of them (unloading) would probably require a
> classloader for each new class:
>
> http://stackoverflow.com/questions/148681/unloading-classes-in-java

I believe classes are properly garbage collected in modern JVMs, so you  
don't have to worry about that and can use a single class loader for all  
adapters. But this should be tested to be sure.

One problem with custom class loaders is that in secure environments you  
need to have permissions to be able to create one. But as many frameworks  
use custom class loaders nowadays, this is not a problem in most cases, I  
guess.

Johan


More information about the stringtemplate-interest mailing list