Because of lack of understanding, I used a spring bean in SINGLETON scope (default). I use this bean to just populate my data structures. The data-structure is populated in the init-method . After the population of my data structures, I don't need the bean any more.While I was profiling my application for possible memory leaks, I figured that this singleton object was occupying a lot of memory (it load a lot of data from the database). 

I guess, the application context hold references of all the singleton beans till it shuts down. Now that I have become wise,I would like to fix the issue. By changing the definition of bean to PROTOTYPE, I think I would make the bean eligible for garbage collection as soon as it gets out of scope which is after it has run the init-method. My question is 

1) Is this the correct way of dealing with the issue.
2) Shown below in the xml snip. DataPopulator is the bean which I would like to be garbage collected once it has executed its init-method. But it hold reference to a singleton object. How this does not hamper the garbage collection? Ideally it should not is what I think. Seeking your opinion.

```
<bean class="com.foo.DataPopulator" init-method="loadDataOnStartUp" **scope="prototype"**>
    <property name="moService" ref="moServiceRef" />
</bean>

<osgi:reference id="moServiceRef" interface="com.foo.IMoDAO"/>

```