title: How to implement a bean-post processor that call destroy methods on prototypes?
body: <p>I'm reading Spring documentation and found this</p>
  
  <blockquote>
    <p>One possible way to get the Spring container to release resources used
    by prototype-scoped beans is through the use of a custom bean
    post-processor which would hold a reference to the beans that need to
    be cleaned up.</p>
  </blockquote>
  
  <p>But if bean-post processor holds a reference to the prototype object then Garbage Collector won't clean it and prototypes beans with their resources will reside in a heap until Application Context is close?</p>
  
  <p>Could you clarify it, please?</p>