即使在我弹出qInt队列中的所有元素之后,以下代码也没有释放3000个元素所消耗的内存.是什么原因 ?
std::queue<int> qInt; //Step01: Check the running memory
for (int i=0;i<3000;i++)
{
qInt.push(i);
}
//Step02: Check the running memory it should have been increased
while(!qInt.empty())
{
qInt.pop();
}
//Step03: Check the running memory expecting Step01 memory but it is still the same of Step02
Run Code Online (Sandbox Code Playgroud)