]> git.sesse.net Git - stockfish/commitdiff
Reduce minimum memory requirement by 16MB
authorlucasart <lucas.braesch@gmail.com>
Tue, 5 Aug 2014 03:42:48 +0000 (11:42 +0800)
committerlucasart <lucas.braesch@gmail.com>
Tue, 5 Aug 2014 03:42:48 +0000 (11:42 +0800)
Stockfish allocates the default hash (32MB) in main(), before entering UCI::loop(). If there is not enough
memory, the program will crash even before UCI::loop() is entered and the GUI is given a change to specify a
lower Hash value.

This defective design could be resolved by doing a lazy allocation upon "isready" command, as the UCI protocol
guarantees that "isready" will be sent at least once before any search. But it's a bit cumbersome when using
Stockfish "manually" to have to remember to type "isready" everytime.

So leave the current design, but reduce the default hash to 16MB instread of 32MB. In order to perform such
quick searches (depth=13), there is no reason to use so much Hash anyway. Another benefit is to introduce a
bit of hash pressure in bench, which increases chances to detect rare bugs related to TT replacement, for
example.

This is not a functional change, although it obviously changes the bench.

bench 7461879

src/ucioption.cpp

index 63d47f30edfcdb9f07029fb2edcb92899ce7a8e6..89b983f83fc13b2d8bf8696c8bdcaa32cb2b76c1 100644 (file)
@@ -60,7 +60,7 @@ void init(OptionsMap& o) {
   o["Contempt Factor"]          << Option(0, -100,  100);
   o["Min Split Depth"]          << Option(0, 0, 12, on_threads);
   o["Threads"]                  << Option(1, 1, MAX_THREADS, on_threads);
-  o["Hash"]                     << Option(32, 1, 1024 * 1024, on_hash_size);
+  o["Hash"]                     << Option(16, 1, 1024 * 1024, on_hash_size);
   o["Clear Hash"]               << Option(on_clear_hash);
   o["Ponder"]                   << Option(true);
   o["MultiPV"]                  << Option(1, 1, 500);