]> git.sesse.net Git - stockfish/commitdiff
Clear TableBase mappings in Search::clear()
authorNooby <>
Sat, 27 Oct 2018 20:12:34 +0000 (04:12 +0800)
committerStéphane Nicolet <cassio@free.fr>
Mon, 19 Nov 2018 08:40:42 +0000 (09:40 +0100)
This patch will make possible to free mapped TB files with "ucinewgame" command.

We wrote this patch specifically to address a problem that arose while
running Stockfish with 7-piece tablebases as a kibitzer at TCEC for
extended periods of time across multiple games. It was noted that after
some time, the NPS of the kibitzing Stockfish (which is usually 3x faster
than the Stockfish actually competing) would drop precipitously, eventually
falling to preposterously low numbers until restarted.

Their eval bot basically inputs FEN, go infinite, stop and loop, it probably
didn't do ucinewgame either. As time goes it gradually slowed down and OS
starts to use swap, this is not reasonable since the engine only uses 16GB
hash and the machine has 1TB physical RAM and does nothing else.

Author : noobpwnftw

Closes https://github.com/official-stockfish/Stockfish/pull/1790

No functional change.

src/main.cpp
src/search.cpp

index c5bf325538f3d66a30566aef023f02235a0920d5..bebce2e0af8dae54e311b624bfdaaec0a94428cc 100644 (file)
@@ -43,7 +43,6 @@ int main(int argc, char* argv[]) {
   Bitbases::init();
   Search::init();
   Pawns::init();
-  Tablebases::init(Options["SyzygyPath"]); // After Bitboards are set
   Threads.set(Options["Threads"]);
   Search::clear(); // After threads are up
 
index d0bbc9675c9618ff780cb51b3f89a8eb8abf31f6..07680f1d1830e4447c7f61da25be41407bc69510 100644 (file)
@@ -187,6 +187,7 @@ void Search::clear() {
   Time.availableNodes = 0;
   TT.clear();
   Threads.clear();
+  Tablebases::init(Options["SyzygyPath"]); // Free up mapped files
 }