G
Ged85
Hi there. I have a problem that is sticked in my mind by days. I hope you can help.
This snippet of code:
map<unsigned long,unsigned long> foo_map;
for (int i = 0;i<K;i++)
foo_map = i;
cout<<"done("<<foo_map.size()<<")"<<endl;
cin>>stop;
cout<<"start empting"<<endl;
for (int i = 0;i<K;i++)
foo_map.erase(i);
cout<<"done("<<foo_map.size()<<")"<<endl;
cin>>stop;
Should empty the map container.
In fact, the size that I go to print turns to be 0. Instead, when I check the OS memory it doesn't change nothing!
As K is huge (order of 10^9), I need that the memory allocated is freed when I erase an element.
Can you give me some snippets, hints, pages, links where I can find some help?
I really thank you all.
Best regards,
G.
This snippet of code:
map<unsigned long,unsigned long> foo_map;
for (int i = 0;i<K;i++)
foo_map = i;
cout<<"done("<<foo_map.size()<<")"<<endl;
cin>>stop;
cout<<"start empting"<<endl;
for (int i = 0;i<K;i++)
foo_map.erase(i);
cout<<"done("<<foo_map.size()<<")"<<endl;
cin>>stop;
Should empty the map container.
In fact, the size that I go to print turns to be 0. Instead, when I check the OS memory it doesn't change nothing!
As K is huge (order of 10^9), I need that the memory allocated is freed when I erase an element.
Can you give me some snippets, hints, pages, links where I can find some help?
I really thank you all.
Best regards,
G.