Skip to main content
gamedev.net
🔒 Locked

std::list.clear not clearing?!?

Started by vesoljc Jan 9, 2004 at 3:52 AM 6 replies 300+ views
Original Post
vesoljc
vesoljc
i''m using std::list with my own class as a template param. the class has no dynamic variables, only float, int and a std::string. when my list is being filled, the mem usage under Task Manager/Processes is growing. after the calcuations, i call clear on my list, i check it''s size and it''s zero, but the mem usage is still the same, it has not droped down... why the mem is''t freed?
Abnormal behaviour of abnormal brain makes me normal...www.zootfly.com
vesoljc
vesoljc
yeah, i know the diff between
<my> and <my*> 

and i using the first one....

[edited by - vesoljc on January 9, 2004 5:12:33 AM]
Abnormal behaviour of abnormal brain makes me normal...www.zootfly.com
CWizard
CWizard
The STL use its own memory handler, that will allocate and free memory in a more efficient manner than through the OS. Thus, the STL is probably still sitting on that memory, ready to give it away on the next allocation needed by an STL object.

Is the memory returned when the list is destroyed/goes out of scope?
vesoljc
vesoljc
i tried this:

int main(int ldArgNum, char** lpArgArray)
{
gdArgNum = ldArgNum;
gpArgArray = lpArgArray;

{
DSS gDSS1;
gDSS1.Init(gdArgNum, gpArgArray);

gDSS1.Update();
gDSS1.mdPEList.clear();
}

// do other stuff, point a

}


dss is my class, init creates the basic stuff and update fills the list. constructor and destructor of gDSS1 are being called, but mem usage is still tha same...
Abnormal behaviour of abnormal brain makes me normal...www.zootfly.com
vesoljc
vesoljc
think it works

tnx
Abnormal behaviour of abnormal brain makes me normal...www.zootfly.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.