It’s expected that all_features_map increases in its size, since you are appending to the list, isn’t it?
I’m not sure I understand the issue correctly, so feel free to post an executable code snippet and explain a bit more what the issue is.