The following code occupies 7000 kb:
vector<vector<int>> v(300005);
While this occupies more than 131 000 kb:
vector<stack<int>> st(300005)
I also tested for deque and queue, which took more than 131 000 kb as well.
The memory usage measurements come from submitting my programs to an online competitive programming judge, since this is where I ran into this issue. Is it a known fact that stack takes more memory than vector or is this a weird thing related to the online judge? I also checked for the memory usage when declaring individual stacks and vectors, and in that case it is the same.