After merging child sets into the parent, you can delete the child sets if you do not need them later. Most problems do not revisit nodes after processing. In C++, explicitly call .clear() on child sets after merging, or use std::move which invalidates the source automatically.
This keeps total memory close to instead of . You are only storing active sets on the current DFS path, not all historical sets. Memory stays linear in practice.