Announcement Announcement Module
No announcement yet.
Temporary init time only beans possible? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • mikejbond
    started a topic Temporary init time only beans possible?

    Temporary init time only beans possible?

    Is it possible to create named beans that can then be dereferenced/deleted once initialization is complete? I have searched various places and can find no way to accomplish this, either through xml configuration or code.

    The issue I am running into is that several beans require an object tree that is built from loading a large set of data. The entirety of this object tree are not needed post-initialization in one configuration of our system and consume a significant amount of memory. It would however be overly expensive to have each bean load this data separately.

  • chelu

    By code is easy, you can get a ConfigurableBeanFactory by ApplicationContextAware interface and call to destroyBean() to release memory.


    Leave a comment: