Simultaneous localization and mapping (SLAM) technology which builds a map in a pose graph has high accuracy but low memory utilization and limitations in handling full memory. This paper proposes a keyframe decision-making method based on the visual SLAM framework and deep reinforcement learning. The keyframe selection instruction is given to the mapper, and the map size is controlled to achieve map modeling. Furthermore, the map increment obtained by 3D reconstruction can obtain the intersection relationship between keyframes. We use a self-defining reward function to create the network learning policy to maximize map coverage and minimize memory usage. Experiments demonstrate that our method can perform accurate map modeling without affecting the quality of the mapping, thus reducing memory requirements.