title: How to create a spring bean with specific number of maximum instances
body: <p>I need to create a spring prototype bean in a server with limited RAM.
  One option is to use a spring bean which is a mix of Singleton and Prototype scopes, where i can specify maximum number of instances and threads.</p>
  
  <p>Is there any way in Spring to create multi instance beans? 
  If not how to we avoid out of memory errors when using spring prototype beans.</p>