-
Notifications
You must be signed in to change notification settings - Fork 30
cannot allocate memory #489
Comments
I found a user with similar problems https://groups.google.com/forum/#!topic/coreos-user/t1RI2K1BdV0 |
Found a way to reproduce it (tested on Digtal Ocean 512mb node):
Edit: It seems like Docker isn't "freeing" the buffer/cache memory. |
Uploaded meminfo here: http://sprunge.us/GCNa |
Cannot reproduce on CoreOS Stable 766.3.0 |
This looks very similar to the issue I reported on coreos-user (linked above). |
I've been experiencing the same issue today on alpha (815.0.0) when running random commands (apt-get install dnsutils) within a container. Do you have Swap enabled on the droplet? I had similar problems on Ubuntu and by enabling swap all problems went away. But in CoreOS it doesn't seem to work. Swap has more than 900M available and still throws "cannot allocate memory" error. |
Nope, I think swap is just a workaround. It seems like docker don't free the memory used by the cache/buffer, it is my theory at least. |
can you check slabtop when you hit oom condition? |
The following is the initial state of slabtop: Active / Total Objects (% used) : 214570 / 236605 (90.7%) Then I run on a container: apt-get install nmap (just a random command) Preparing to unpack .../python-lxml_3.4.0-1_amd64.deb ... $ free -h |
Just hit it on CoreOS stable (766.3.0)
/proc/meminfo
Slabtop
|
May be related moby/moby#8539 |
@klausenbusk are you sure the iptables issue is the same? The previous issue you noted and the one I emailed the list about were trigged by launching docker containers, not by running docker itself. Both exhibit the same OOM symptom but they might have different root causes. |
Not sure, they is both a memory allocate problem. The iptables error is also when launching a docker container. |
@bfallik Could you try to set /sys/kernel/mm/transparent_hugepage/enabled to always, and see if it fix it? I can't reproduce the issue anymore on alpha, so can't test if transparent_hugepage fix it. |
@klausenbusk yes I can but I'll need to get back to you later today or tomorrow. |
@klausenbusk Unless I'm misreading transparent_hugepage/enabled is set to always automatically:
This is the default setting. I'm still easily able to reproduce the memory allocation errors on CoreOS 815.0.0. Am I misreading the output or did you mean to suggest I try changing the setting to "madvise" or "never"? |
On Digital Ocean the default is never. What does /proc/buddyinfo? Maybe it some memory fragmentation, through I think the kernel should handle that.. |
Ah, interesting. I'm running CoreOS from Vagrant on VirtualBox.
|
@bfallik Could to try setting vm.min_free_kbytes to 50000? I'm really not a expert, just trying to understand how memory work in Linux :) and haven't found a reliable way to reproduce it in the last alpha. |
@klausenbusk Sure, no problem. I can reliably reproduce this failure every time on alpha so I'm happy to run trials to help resolve this. Speaking of which I think we're making progress! I can reliable run the tests by increasing the min_free_kbytes and I can reproduce the failure by reseting it back to the original value. |
Ugh, I pressed submit too soon. Please ignore my previous comment. Increasing min_free_kbytes did allow the tests to pass but reseting it back to the original value had no effect. I need to poke around a bit more. |
Some links, I found when trying to understand memory:
I think you need to fell the buffer/cache again. See step 1. I do the following steps to trigger it on my node:
|
@bfallik What is your process to reproduce the error? I would like to help you debug it. |
@leonfs Thanks! It's fairly simple for us to reproduce. We had a set of Docker containers we run as part of our internal integration tests. As of CoreOS 808.0.0 we encounter memory errors every time we invoke the tests on our standard VM size with 1024GB of RAM. In 766.x and earlier versions the tests always pass. As a workaround for our developers we've increased the default VM size to 1536GB. Obviously this is not a real fix. The increase to 1536GB is why I was confused yesterday. My local VM had been recreated at that the larger size which explained why I saw inconsistent results. Now that I'm back to 1024GB RAM, here are my results of testing against a fresh 1024GB VM running 815.0.0. Sorry if this is messy but I can clarify if you have any questions. trial 1min_free_kbytes at default (3846);
trial 2(same config as trial 1) similar results:
trial 3
tests pass; tried twice in a row trial 4
tests pass; tried twice in a row I'm not sure I understand the real effect, if any, min_free_kbytes is having on the results. I'm also not sure if changing this to a lower setting has any effect or if the kernel can only increase the minimum. It may also be worth mentioning that failures occur very early in the process before the point where the final container, the one actually running the tests, gets started. We encounter memory errors running containers that wrap test dependencies like postgres and redis. |
Excepted, it take some time before the 461454 kbytes is used again, by cache/buffer. Try wait a little while, or fill the cache/buffer. Kind of explanation of cache/buffer here: http://stackoverflow.com/questions/6345020/linux-memory-buffer-vs-cache |
I've been able to reproduce this without involving docker at all, so we can eliminate that variable. Right now it looks like a kernel regression, and overlayfs is effective at triggering it. Simply read /dev/vda into /dev/null as @klausenbusk did above then try write to a file on overlayfs triggering a copy_up, it will trigger the allocation failure. There are plenty of reclaimable buffers but for some reason they aren't being reclaimed before kmalloc fails. |
@vcaputo nice catch! hopefully the isolated reproduction case will make it easier to track down the regression. |
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> (cherry picked from commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe)
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com> (cherry picked from commit f641fdbd8ca737df49e96d9d58206fb0a9d82512)
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe upstream. Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com> (cherry picked from commit 7babbe3844b400ccf9e95974bfc71b4ff0a89f77)
[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ] Rather than always allocating the high-order XATTR_SIZE_MAX buffer which is costly and prone to failure, only allocate what is needed and realloc if necessary. Fixes coreos/bugs#489 Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
I get his error on CoreOS alpha (808.0.0), through I have "plenty" of memory available (300mb+).
Like this:
/proc/meminfo
I haven't found a way to reproduce it. Got it yesterday on one of my web node, and today on the second web node.
The text was updated successfully, but these errors were encountered: