This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josh.r
Recipients asvetlov, hinxx, josh.r, vstinner, yselivanov
Date 2019-02-13.18:07:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550081234.86.0.542135888347.issue35988@roundup.psfhosted.org>
In-reply-to
Content
"your application is using more memory than what is available in the system." 

Well, it alone may not be using more memory, but the cumulative usage on the system is "too high" by whatever metric the OOM killer is using (IIRC the default rule is that actual committed memory must be less than swap size + 50% of RAM). The OOM killer is a strange and terrible beast, and the behavior varies based on configuration, relative memory usage of each process grouping, minimizing number of processes killed, etc.

You can find deep implementation details on it (including how to disable a given process for consideration) here: https://linux-mm.org/OOM_Killer

The real solution to problems like this usually amounts to:

1. Install more RAM.

2. Increase the size of your swap partition. Doesn't "fix" being shy of memory if you're actually using more memory than you have RAM, but allows you to handle overcommit (particularly for fork+exec scenarios where the forked process's memory will be freed momentarily) without the OOM killer getting involved, and to limp along slowly, without actually failing, if you actually allocate and use more memory than you have RAM.

3. Tweak the overcommit heuristics to allow more overcommit before invoking the OOM killer.

4. Disable overcommit entirely, so memory allocations fail immediately if sufficient backing storage is not available, rather than succeeding, only to invoke the OOM killer when the allocated memory gets used and the shortage is discovered. This is a good solution if the program(s) in question aren't poorly designed such that they try to allocate many GBs of memory up front even when they're unlikely to need it; unfortunately, there are commonly used programs that overallocate like this and render this solution non-viable if they're part of your setup.

Regardless, this isn't a bug in Python itself. Any process that uses a lot of memory (Apache, MySQL) and hasn't explicitly removed itself from OOM killer consideration is going to look tasty when an OOM scenario occurs.
History
Date User Action Args
2019-02-13 18:07:14josh.rsetrecipients: + josh.r, vstinner, asvetlov, yselivanov, hinxx
2019-02-13 18:07:14josh.rsetmessageid: <1550081234.86.0.542135888347.issue35988@roundup.psfhosted.org>
2019-02-13 18:07:14josh.rlinkissue35988 messages
2019-02-13 18:07:14josh.rcreate