N
nw
Hi all,
I have an issue where memory doesn't appear to be being freed from a
map containing vectors. I'm trying to use the swap trick to do this,
but my memory usage (as reported by VSize on Linux) doesn't seem to go
down.
The the following code segment signals is a map of vector<int>s.
identifier is a string index in to this.
vector<vector<int> > mst;
(signals.find(identifier)).second).clear();
(signals.find(identifier)).second).swap(mst);
(signals.find(identifier)).second).erase(identifier);
I would imagine the clear is not required and I've tried with and
without it. I'm getting to the point where I'm wondering if this is a
operating system issue rather than anything to do with C++.
I have an issue where memory doesn't appear to be being freed from a
map containing vectors. I'm trying to use the swap trick to do this,
but my memory usage (as reported by VSize on Linux) doesn't seem to go
down.
The the following code segment signals is a map of vector<int>s.
identifier is a string index in to this.
vector<vector<int> > mst;
(signals.find(identifier)).second).clear();
(signals.find(identifier)).second).swap(mst);
(signals.find(identifier)).second).erase(identifier);
I would imagine the clear is not required and I've tried with and
without it. I'm getting to the point where I'm wondering if this is a
operating system issue rather than anything to do with C++.