I think DBOW2 can be used online, however I don't think its computation is bounded over time (as the scale of the environment increases) like RTAB-Map.
Thank you for your quick reply.You mean that rtmap uses online training dictionary and the dictionary in increasing?
And I also want to know how to choose k in kmean++?
Yes, and there is a memory management mechanism that limits the time used for dictionary update and loop closure estimation to a fixed time threshold. See the papers for more info.