Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in debio/redeem/develop (pull request intelligent-agent#111)
Don't Hold on to Step Buffers After a Path is Complete Paths in the path planner live in a circular buffer and store all their steps in vectors. When we're done with a path, we zero it and eventually it gets filled again. Originally, we were clearing the vectors of steps with std::vector.clear(), which clear out all the old steps but holds on to underlying buffer. Normally this is an optimization, but it also means that every axis of every path in the path queue (which is a few thousand elements long) will always hold on to the largest buffer it's had to use so far. This isn't a "leak" per se because we know where all that memory is and no pointers have been "lost," but this does cause Redeem memory usage to rise until it exceeds the maximum of the BBB, particularly on prints with very long moves with many steps. To fix this, swap the step vectors with empty vectors to force std::vector to free these underlying buffers and re-allocate whenever a Path is used.
- Loading branch information