From 8b88ca901779524ef17cb26c1278cb54ea3be6ae Mon Sep 17 00:00:00 2001 From: lucasart Date: Tue, 5 Aug 2014 11:42:48 +0800 Subject: [PATCH] Reduce minimum memory requirement by 16MB 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 63d47f30..89b983f8 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -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); -- 2.39.2