Code Monkey home page Code Monkey logo

Comments (4)

mjsabby avatar mjsabby commented on May 19, 2024 2

It's best to surface this as an option to the consumer, since Windows, Linux and macOS can all support Large Pages.

A build variant seems less ideal.

from mimalloc.

4cad avatar 4cad commented on May 19, 2024 1

Just a heads up to be wary when using large pages to folks looking to use this feature, performance boost can be significant but large pages cannot be paged to disk so it essentially grabs physical memory and is trickier to manage.

Implication 1) If you allocate too many large pages you it ends up starving the system of physical memory including the OS, and I have had many a machines lock up completely and become unresponsive under high memory pressure - it is one of those rare bugs that takes down the whole system, and not just the process. We dealt with it by falling back to regular pages after some threshold % of physical memory was given to large pages, so that at least the OS always had memory to work with.

Implication 2) In order for the OS to allocate a large page, it needs to have a full contiguous block of physical memory equal to the size of the large block. I do not know what this entails, but when the system is saturated it can presumably involve de-fragmenting memory or just failing. We had to add a fall-back to handle the case where if a large page allocation fails, we retry with normal pages to handle this.

from mimalloc.

daanx avatar daanx commented on May 19, 2024

I didn't look into this before but it seems easy to support this on Windows -- I can definitely make this a build variant for you to test :-) However, it would preclude the guard pages in the secure mode.

from mimalloc.

daanx avatar daanx commented on May 19, 2024

I pushed initial support for large pages on Windows on the dev branch. It is enabled when setting the environment variable MIMALLOC_LARGE_OS_PAGES=1. (note that the "Lock Pages in memory" privilege must be enabled for the user account for it to work).

from mimalloc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.