哈希表...再次 [英] hash table...again
问题描述
首先,我想原谅自己写这个小组,尽管我知道这不是一个标准的C ++问题。我写信给
microsoft.public.dotnet.lang.vc但似乎没有人回答我,并且
这是非常紧急的。 />
无论如何,我有这样的事情:
hash_map< double,intmapa;
double md = 0;
for(int j = 0; j< 1000000; ++ j)
{
mapa [md] = 3;
md ++;
}
和你一样我可以看到,我只是试图散列很多数据。我的问题是
这耗费了70 MB的内存,这在我看来有点太多了。任何想法
出了什么问题?
再次,对不起是非正式的
-
你永远不会太年轻,没有越南闪回
first of, i''d like to excuse myself for writing in this group, even though i
know this is not a standard C++ question. i''ve written to
microsoft.public.dotnet.lang.vc but no one seems to be answering me, and
it''s pretty urgent.
any way, i have something like this:
hash_map<double, intmapa;
double md = 0;
for(int j=0;j<1000000;++j)
{
mapa[md] = 3;
md++;
}
as you can see, i''m simply trying to hash a lot of data. my problem is that
this uses up 70 MB of memory,which seems to me a bit too much. any ideas
what went wrong?
again, sorry for being offtopic
--
You''re never too young to have a Vietnam flashback
推荐答案
filox写道:
filox wrote:
首先,我想原谅自己写这个小组,尽管我知道这不是一个标准的C ++问题。我写信给
microsoft.public.dotnet.lang.vc但似乎没有人回答我,并且
这是非常紧急的。
first of, i''d like to excuse myself for writing in this group, even though i
know this is not a standard C++ question. i''ve written to
microsoft.public.dotnet.lang.vc but no one seems to be answering me, and
it''s pretty urgent.
实际上,这不是偏离主题的。 FAQ 5.9说这里的主题是
标准C ++语言和库以及计划扩展和
调整。 TR1,标准库的一些计划扩展,
包括unordered_map,它(我相信)与
hash_map基本相同,但名称不同,以免造成
代码使用您正在使用的常用扩展程序的问题。
Actually, it''s not off-topic. FAQ 5.9 says that the topic here is the
standard C++ language and libraries and "planned extensions and
adjustments." TR1, some planned extensions to the standard library,
includes unordered_map, which is (I believe) essentially the same as
hash_map but with a different name so as not to cause problems with
code using the common extension you are using.
无论如何,我有类似的东西:
hash_map< double,intmapa;
double md = 0;
for(int j = 0; j< 1000000; ++ j)
{
mapa [md] = 3;
md ++;
}
你可以看到,我只是试图散列很多数据。我的问题是
这耗费了70 MB的内存,这在我看来有点太多了。任何想法
出了什么问题?
any way, i have something like this:
hash_map<double, intmapa;
double md = 0;
for(int j=0;j<1000000;++j)
{
mapa[md] = 3;
md++;
}
as you can see, i''m simply trying to hash a lot of data. my problem is that
this uses up 70 MB of memory,which seems to me a bit too much. any ideas
what went wrong?
你怎么知道它需要70 MB?
干杯! --M
How do you know it takes 70 MB?
Cheers! --M
" mlimber" < ml ***** @ gmail.com写信息
news:11 ******************** @ e64g2000cwd.googlegrou ps .com ...
"mlimber" <ml*****@gmail.comwrote in message
news:11********************@e64g2000cwd.googlegrou ps.com...
filox写道:
filox wrote:
>首先,我想要原谅自己写这个小组,甚至
虽然我知道这不是一个标准的C ++问题。我写信给
microsoft.public.dotnet.lang.vc,但似乎没有人回答我,而且这很紧急。
>first of, i''d like to excuse myself for writing in this group, even
though i
know this is not a standard C++ question. i''ve written to
microsoft.public.dotnet.lang.vc but no one seems to be answering me, and
it''s pretty urgent.
实际上,这不是偏离主题的。 FAQ 5.9说这里的主题是
标准C ++语言和库以及计划扩展和
调整。 TR1,标准库的一些计划扩展,
包括unordered_map,它(我相信)与
hash_map基本相同,但名称不同,以免造成
代码使用您正在使用的常用扩展程序的问题。
Actually, it''s not off-topic. FAQ 5.9 says that the topic here is the
standard C++ language and libraries and "planned extensions and
adjustments." TR1, some planned extensions to the standard library,
includes unordered_map, which is (I believe) essentially the same as
hash_map but with a different name so as not to cause problems with
code using the common extension you are using.
>无论如何,我有类似的东西:
hash_map< double,intmapa;
double md = 0;
for(int j = 0; j< 1000000; ++ j)
{
mapa [md] = 3;
md ++;
}
你可以看,我只是试图散列很多数据。我的问题是
这耗费了70 MB的内存,这在我看来有点太多了。任何想法
出了什么问题?
>any way, i have something like this:
hash_map<double, intmapa;
double md = 0;
for(int j=0;j<1000000;++j)
{
mapa[md] = 3;
md++;
}
as you can see, i''m simply trying to hash a lot of data. my problem is
that
this uses up 70 MB of memory,which seems to me a bit too much. any ideas
what went wrong?
你怎么知道需要70 MB?
How do you know it takes 70 MB?
因为Windows任务管理器这么说......
because the windows task manager says so...
filox写道:
filox wrote:
" mlimber" < ml ***** @ gmail.comwrote
"mlimber" <ml*****@gmail.comwrote
你怎么知道它需要70 MB?
How do you know it takes 70 MB?
,因为Windows任务管理器这样说...
because the windows task manager says so...
>从什么我已经读过,任务管理器不是
的可信赖来源
>From what I''ve read, the Task Manager is not a trustworthy source of
有关此计数的信息。询问有关计算内存的可靠方法
在Windows新闻组中的使用情况,一旦您对
数字有信心,请在必要时再次询问。
干杯! --M
information on this count. Ask about reliable ways to calculate memory
usage in a Windows newsgroup, and once you are confident in the
numbers, ask here again if necessary.
Cheers! --M
这篇关于哈希表...再次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!