VirtualBox

Changeset 84633 in vbox for trunk/src/VBox/VMM/VMMR3/PGM.cpp


Ignore:
Timestamp:
Jun 2, 2020 11:12:01 AM (4 years ago)
Author:
vboxsync
Message:

PGM: Log /proc/sys/vm/max_map_count and warn if too low. bugdbref:31418985

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r82968 r84633  
    644644#include <iprt/string.h>
    645645#include <iprt/thread.h>
     646#ifdef RT_OS_LINUX
     647# include <iprt/linux/sysfs.h>
     648#endif
    646649
    647650
     
    10391042        }
    10401043#endif
     1044
     1045#ifdef RT_OS_LINUX
     1046        /*
     1047         * Log the /proc/sys/vm/max_map_count value on linux as that is
     1048         * frequently giving us grief when too low.
     1049         */
     1050        int64_t const cGuessNeeded = MMR3PhysGetRamSize(pVM) / _2M + 16384 /*guesstimate*/;
     1051        int64_t       cMaxMapCount = 0;
     1052        int rc2 = RTLinuxSysFsReadIntFile(10, &cMaxMapCount, "/proc/sys/vm/max_map_count");
     1053        LogRel(("PGM: /proc/sys/vm/max_map_count = %RI64 (rc2=%Rrc); cGuessNeeded=%RI64\n", cMaxMapCount, rc2, cGuessNeeded));
     1054        if (RT_SUCCESS(rc2) && cMaxMapCount < cGuessNeeded)
     1055            LogRel(("PGM: WARNING!!\n"
     1056                    "PGM: WARNING!! Please increase /proc/sys/vm/max_map_count to at least %RI64 (or reduce the amount of RAM assigned to the VM)!\n"
     1057                    "PGM: WARNING!!\n", cMaxMapCount));
     1058
     1059#endif
     1060
    10411061        return VINF_SUCCESS;
    10421062    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette