Doesn't nodeTo() allocate memory? It's returning objects without being passed any container structure, so either it's allocating memory, or it's retuning pointers to a static or global container.
You're right, it's doing the latter. Not allocating new memory, but returning a pointer to one of the nodes in a 2-dimensional array, which is an instance variable of the Maze2d class that this method is a part of.
This is so totally weird I can't get over it. Whenever I comment out all the push_back and erase calls, the memory stays perfectly constant and well-behaved! So it "has" to be those function calls, but in theory they should not be doing any allocation...
Just a question: when you call your std::cout methods, you call some overloaded operators (which, no doubt, do memory allocation). Did you try testing the return values of vector::capacity() through the debugger *only*?