How many objects at once is too many? (I know, it DEPENDS!)

Dear Experts,

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...

Thanks,
BrianMc1958
BrianMc1958Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
0
BrianMc1958Author Commented:
OK. Read that.

For the data alone I'm storing in the bean then, probably about 100 bytes.  (The Strings are all short.) Then there are about a dozen standard getters and setters.  There are simple hashCode, clone and equals overrides, and  whatever "space overhead" any Object might have.

Would anyone like to take a guess at the total-bytes-per-bean?  200 bytes?  1,000 bytes?

Thanks...
0
objectsCommented:
~ 150 bytes would be a good enough estimate
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

BrianMc1958Author Commented:
OK.  Can I have 500,000 of those at once in memory, for a total of 75,000,000 bytes?  Ordinary PC's now come with ten times that amount of memory.  My application will be running in the real world on servers that should have somewhere between 2 and 8 gig, and of course will have other applications running on them at the same time.

I'm guessing that if such a system can't spare 75 meg, it's got very serious problems anyway.

What do you think?  Can I do it?

--BrianMc1958
0
objectsCommented:
thats fine, if you need more memory you can specify it on the command line when u start up the app using -Xmx option

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BrianMc1958Author Commented:
Thanks!

--BrianMc1958
0
objectsCommented:
no worries :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.