Community
Participate
Working Groups
Build 20020226 Once a binary type has been created, the classfile bytes should be released.
It feels that the ClassFileReader populates anyway all of its structural information (field & method) anyway, so the need for the bytes is minimal (thrown exceptions ? etc...) why not having a mode for eagerly caching these as well. What would the difference be ? Getting rid of the bytes is probably a big win.
We need to add a flag on the class file reader to initialize the whole structure on the creation. The bytes are persisted because we need them in order to be able to resolve constant pools entries. The class file reader is a lazy reader. It doesn't initialize an object till this object is requested (e.g. signature of method info, ...).
I added new methods to create ClassFileReader which take an extra argument. This argument is used to fully initialize all fields inside the class file reader. When this is done, the class file reader doesn't keep the bytes around. We need to see if this is a big win in term of memory consumption.
The class file reader now is capable of releasing the bytes once fully initialized. Fixed and released in HEAD.