How much memory does a hashtable use?

Posted by Michael on Stack Overflow See other posts from Stack Overflow or by Michael
Published on 2010-05-05T21:12:57Z Indexed on 2010/05/05 21:18 UTC
Read the original article Hit count: 226

Filed under:
|
|
|

Would a hashtable/hashmap use a lot of memory if it only consists of object references and int's?

As for a school project we had to map a database to objects (that's what being done by orm/hibernate nowadays) but eager to find a good way not to store id's in objects in order to save them again we thought of putting all objects we created in a hashmap/hashtable, so we could easily retrieve it's ID. My question is if it would cost me performance using this, in my opinion more elegant way to solve this problem.

© Stack Overflow or respective owner

Related posts about java

Related posts about hashmap