F
filox
so, i'm using the hash_map that comes with MS visual studio, and it seems to
spend an awful lot of memory. what i basiclly have is something like this:
hash_map<char*, int> a;
char* b = new char[17];
int i;
//some code that initializes b and i
a = i;
i do that for a huge amount of data and end up with 470 MB of memory for the
table. now, if i got it right, it should actually use (17*1+4)*3700000 = 78
MB ((17*sizeof(char) + sizeof(int)) * number_of_times_i_do_the_hashing). so,
any ides what is going on?
does hash_map use some extra memory to keep track of things and if so, is
there some other implementation of a hash table that i could use?
or am i just not seeing something?
spend an awful lot of memory. what i basiclly have is something like this:
hash_map<char*, int> a;
char* b = new char[17];
int i;
//some code that initializes b and i
a = i;
i do that for a huge amount of data and end up with 470 MB of memory for the
table. now, if i got it right, it should actually use (17*1+4)*3700000 = 78
MB ((17*sizeof(char) + sizeof(int)) * number_of_times_i_do_the_hashing). so,
any ides what is going on?
does hash_map use some extra memory to keep track of things and if so, is
there some other implementation of a hash table that i could use?
or am i just not seeing something?