-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need guidelines around max memory usage #393
Comments
First of all, try to test with the However, generally If you set the Still, the peak memory usage is mostly determined by your program and actual memory usage. Easy to test by also running without mimalloc and seeing how the memory usage differs. |
Thanks, running again at This is good. Thank you for your help so far. However, this still doesn't address the broader problem. Using 16GB instead of 10GB seemed like a bug but since it stabilizes and there is no guideline on how much RAM mimalloc "should" be using I don't really know for sure. A potential use case I have is building an data analysis server. Requests come in and run analytics on some portion of data. I can determine how much data the request requires (in bytes) and so I need to figure out if I have enough RAM to process the request right now or if I need to block until one of the currently running requests is finished. Ideally I'd like to avoid getting close to 100% RAM utilization and probably target something like 90%. So a concrete example of the challenge I am facing is... Currently I have 13GB free. If I am just using malloc then I know I can do so. If 60% overhead is "technically possible" then I have to play it safe and queue the request. However, if 60% is "definitely a bug" (possibly in the way I am using the allocator) then I can be aggressive and fix my allocation behavior / mimalloc version when bugs are encountered. |
This is related to #383 and #351 although in this case I'm looking more for guidance than a fix. I understand that mimalloc may overallocate and hold onto RSS after the memory is freed and so a system will need more RAM available to avoid running out of memory.
However, it is not very clear to me exactly how much RAM I will need. I am using mimalloc through Apache Arrow. In some cases, when processing an 8GB dataset, the RSS will grow to 27GB. This has made it difficult to figure out what kind of server we need to purchase / configure even though the size of our data is known. It will be even more difficult for more sophisticated approaches (such as a server that delays requests until the server has enough RAM to process them, ensuring OOM errors are avoided).
It's possible this behavior is a bug or some kind of bad scenario that can be avoided (I'm going to work through the suggestions in #351). However, even if that is the case, I would still like to have a better idea of the maximum amount of RAM that I can expect mimalloc to use.
The text was updated successfully, but these errors were encountered: