Hi,
Yes, map_optimizer doesn't know when there is a loop closure detected, so it always optimizes it. Well, this could be detected by looking if a new loop closure link has been added to the graph.
Note that rtabmap node's optimization
should be disabled if you are using map_optimizer.
cheers