Whenever -blocksonly is specified, there is implicitly a zero size mempool. However, there is still a non-zero value for -maxmempool which will be shared with dbcache, leading to 300 MB extra usage. Fix this.
{
    
    
    
    
    std::set_new_handler(std::terminate);
    LogPrintf("Error: Out of memory. Terminating.\n");
    
    std::terminate();
};
bool AppInitBasicSetup(const ArgsManager& args)
{
    
#ifdef _MSC_VER
    
    _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
    _CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, 0));
    
    _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
#endif
#ifdef WIN32
    
    HeapSetInformation(nullptr, HeapEnableTerminationOnCorruption, nullptr, 0);
#endif
    if (!InitShutdownState()) {
        return InitError(Untranslated("Initializing wait-for-shutdown state failed."));