How many objects at once is too many? (I know, it DEPENDS!)
Posted on 2006-03-27
I have an existing class that was designed to hold in memory basic information about a few HUNDRED customers at the same time. Now the business people would like to increase that to--possibly--a few HUNDRED THOUSAND customers at the same time. My first thought was I had to rewrite, but I thought I'd ask here first.
I'm storing each customer in a data bean, and storing all the data beans at once in a HashSet. There are about a dozen fields in the data bean--a few int's, a few String's, and a few long's. I'm afraid I have no idea how much actual memory such a bean takes up. And whatever it is, it would be multiplied a few hundred thousand times.
I know the answer is "It DEPENDS", but is that way too much memory to grab at once? Conversely, is it definitely NOT too much? (Have you done something similar in the real world?) Ballpark answers would be greatly appreciated...