Home arrow static arrow Java Programming [Archive] - huge hashtable?
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - huge hashtable?
This topic has 6 replies on 1 page.

Posts:65
Registered: 6/21/04
huge hashtable?  
Jul 15, 2004 2:20 PM



 
I am manipulating a set of data which has about 2.5 million entries. I would like to use Hashtable, but it runs out of memory. How big can a hashtable get? Is it even worth trying to experiment with the load factor to try to decrease amount of space needed? Does anyone have any suggestions for trying to manipulate data of that size?

Thanks
 

Posts:31,095
Registered: 4/30/99
Re: huge hashtable?  
Jul 15, 2004 2:24 PM (reply 1 of 6)



 
Use a database table.
 

Posts:3,258
Registered: 00-08-28
Re: huge hashtable?  
Jul 15, 2004 2:25 PM (reply 2 of 6)



 
any particular reasons why you would like to use hashtable and not hashmap or any other collection. Only once the whole story is known can a solution be suggested.
 

Posts:3,258
Registered: 00-08-28
Re: huge hashtable?  
Jul 15, 2004 2:26 PM (reply 3 of 6)



 
http://www.javapractices.com/Topic65.cjp

This might help in making a decision as to which collection to use.
 

Posts:3,258
Registered: 00-08-28
Re: huge hashtable?  
Jul 15, 2004 2:31 PM (reply 4 of 6)



 
But again I would agree with the Dr. it would be better to use a database for the purpose.
 

Posts:18,384
Registered: 21.03.00
Re: huge hashtable?  
Jul 16, 2004 12:21 AM (reply 5 of 6)



 
Hi,

It's probably your java application that runs out of memory. Try to increase the heap size for the application (look at the parameters -Xms and -Xmx to the jvm)

/Kaj
 

Posts:6,487
Registered: 5/5/04
Re: huge hashtable?  
Jul 16, 2004 3:10 AM (reply 6 of 6)



 
Say each entry uses 1 K, then you need 2.5 million * 1 K at least. About 2-3 GB of memory.
You may find that on WIndows systems you are limited to about 1.3 GB usable even if you have this much memory.
With 64-bit Java you can use more than this.
Note: you must have enough free system memory to store these objects in memory.

Or you could use a database table.
 
This topic has 6 replies on 1 page.