H
hamishd
Hello,
In my application I create some large vectors to hold data. For
example:
std::vector<DataItemClass*> MyData;
DataItemClass * DataItem;
for(i=0;i<SomeLargeLimit;i++){
DataItem = new DataltemClass;
MyData.push_back(DataItem);
}
So while my application is running, I can watch in the "Windows Task
Manager" under "Processes" my application's mem usage increase as I
allocate more memory. Eg, say to 150,000KB.
How do I release this memory?
I go:
for(i=0;i<MyData.size();i++)
delete(MyData);
MyData.clear();
But my mem usage does not reduce... so when i run the process a few
times the usage gets really really large, and windows gives me virtual
memory usage warnings (or similar).
When I run the application in debug mode, the same thing occurs, and i
can confirm the "delete" operations are being executed. MSVC++ 6.0 does
not show any memory leaks, so why is my memory usage not clearing?
In my application I create some large vectors to hold data. For
example:
std::vector<DataItemClass*> MyData;
DataItemClass * DataItem;
for(i=0;i<SomeLargeLimit;i++){
DataItem = new DataltemClass;
MyData.push_back(DataItem);
}
So while my application is running, I can watch in the "Windows Task
Manager" under "Processes" my application's mem usage increase as I
allocate more memory. Eg, say to 150,000KB.
How do I release this memory?
I go:
for(i=0;i<MyData.size();i++)
delete(MyData);
MyData.clear();
But my mem usage does not reduce... so when i run the process a few
times the usage gets really really large, and windows gives me virtual
memory usage warnings (or similar).
When I run the application in debug mode, the same thing occurs, and i
can confirm the "delete" operations are being executed. MSVC++ 6.0 does
not show any memory leaks, so why is my memory usage not clearing?