T
Tassilo Horn
Hi all,
we have some MDA-style library here. Basically, you define some schema
(something like a UML class diagram), and then a code generator creates
bytecode for the classes and associations in memory, and a custom class
loader invokes ClassLoader.defineClass(). Then you can create graphs
(like UML object diagrams) conforming that schema, which instantiates
the generated classes.
Now there's also a model-transformation language, that creates new
graphs conforming to new schemas out of old graphs, and those new
classes are also compiled in memory. Many transformations run in
several steps, and each step compiles new classes.
So it's not seldom, that finally there are 10.000 classes in memory,
which results in an OutOfMemoryError: PermGen space. Increasing PermGen
space using the relevant command line switch works, but isn't there a
better way?
For example in such step-by-step transformations, I'm sure that the
classes created in intermediate steps cannot be used from outside, and
that it's ok to forget the classes defined in step i when finishing step
i+1. For those intermediate classes, I do know the exact prefix of the
fully qualified name all those classes share, so I'm looking for
something like
System.forgetAllClasses(myPrefix);
Any pointers are highly appreciated.
Bye,
Tassilo
we have some MDA-style library here. Basically, you define some schema
(something like a UML class diagram), and then a code generator creates
bytecode for the classes and associations in memory, and a custom class
loader invokes ClassLoader.defineClass(). Then you can create graphs
(like UML object diagrams) conforming that schema, which instantiates
the generated classes.
Now there's also a model-transformation language, that creates new
graphs conforming to new schemas out of old graphs, and those new
classes are also compiled in memory. Many transformations run in
several steps, and each step compiles new classes.
So it's not seldom, that finally there are 10.000 classes in memory,
which results in an OutOfMemoryError: PermGen space. Increasing PermGen
space using the relevant command line switch works, but isn't there a
better way?
For example in such step-by-step transformations, I'm sure that the
classes created in intermediate steps cannot be used from outside, and
that it's ok to forget the classes defined in step i when finishing step
i+1. For those intermediate classes, I do know the exact prefix of the
fully qualified name all those classes share, so I'm looking for
something like
System.forgetAllClasses(myPrefix);
Any pointers are highly appreciated.
Bye,
Tassilo