detecting the memory page size

Viewed 14973

Is there a portable way to detect (programmatically) the memory page size using C or C++ code ?

7 Answers

Windows 10, Visual Studio 2017, C++. Get the page size in bytes.

int main()
{
    SYSTEM_INFO sysInfo;

    GetSystemInfo(&sysInfo);

    printf("%s %d\n\n", "PageSize[Bytes] :", sysInfo.dwPageSize);

    getchar();

    return 0;
}
Related