In my servlet I get a spring bean that is scoped as prototype. Will this bean get destroyed, as would any de-ref'd object during GC, or do non-referenced prototype beans hang around until the container shuts down? I'm assuming if the bean is de-refed and destroyed that its dependencies are also destroyed (assuming zero references) and its dependencies are destroyed, and so on...
I'm just getting the hand of IOC and want to make sure that my prototype objects are not leaving a pile of objects on the heap when they have no references.
i.e.: bean C is invoked programaticaly by getBean(). B->was injected into C and A-> was injected into B
I'm hoping that when C has no more references or the reference goes out of scope, that C,B and A are cleaned up during the GC cycle. (assuming A,B,C are all scoped as prototype)
Can anyone recommend a good, lightwieght profiler to monitor which beans (objects) are on the heap in realtime? I'm using JProbe now, but its more than I need (or can handle at the moment..)
Thanks a lot .. Spring has me excited about coding again...!