pazusoba / core

Try to solve Puzzle & Dragons with C++
MIT License
15 stars 1 forks source link

V2 - Reduce Memory Usage #28

Closed HenryQuan closed 3 years ago

HenryQuan commented 3 years ago

For a small beam size, the clean up is almost instant because there aren't many states. However, when the beam size is over 100,000. The clean up will become slow and also the memory usage is crazy. I tried beam size 2,000,000 with max 25 steps. 50Gb was used. My machine was out of memory so it had to store it on the SSD. This slows down the program massively.

It might be better to store the routes in every single state so that the parent state can be cleaned after children states are created. This will reduce memory usage significantly.