Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jun 2016 15:24:40 -0700
From:      Mark Johnston <markj@FreeBSD.org>
To:        "Mikhail T." <mi+oro@aldan.algebra.com>
Cc:        freebsd-stable@FreeBSD.org
Subject:   Re: Nasty state after running out of swap
Message-ID:  <20160608222440.GA28489@charmander>
In-Reply-To: <057d6b66-8051-213f-e716-efada3692bc0@aldan.algebra.com>
References:  <057d6b66-8051-213f-e716-efada3692bc0@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 08, 2016 at 05:02:09PM -0400, Mikhail T. wrote:
> In my absence my desktop managed to run out of memory and had to kill a 
> number of processes:
> 
>     pid 47493 (firefox), uid 105, was killed: out of swap space
>     pid 1665 (thunderbird), uid 105, was killed: out of swap space
>     pid 975 (kdeinit4), uid 105, was killed: out of swap space
>     pid 1344 (mysqld), uid 105, was killed: out of swap space
>     pid 898 (Xorg), uid 0, was killed: out of swap space
>     pid 1430 (pidgin), uid 105, was killed: out of swap space
> 
> While that's unfortunate in its own right, the current state of the 
> machine is just weird... After the massacre the swap-usage is down to 5% 
> and memory is plentiful. top(1) reports:
> 
>     last pid: 85719;  load averages:  0.17,  0.15, 0.11     up
>     25+21:17:34  16:50:27
>     123 processes: 1 running, 102 sleeping, 11 stopped, 8 zombie, 1 waiting
>     CPU:  0.1% user,  0.0% nice,  1.8% system,  0.3% interrupt, 97.7% idle
>     Mem: 17M Active, 7276K Inact, 9876M Wired, 10M Cache, 1032M Buf, 28M
>     Free

This looks like a memory leak in the kernel. What revision are you
running? Can you provide the output of "vmstat -m" and vmstat -z"?

>     ARC: 1114M Total, 264M MFU, 282M MRU, 69K Anon, 44M Header, 524M Other
>     Swap: 12G Total, 616M Used, 11G Free, 5% Inuse
> 
> And yet, various commands hang for a while in either pfault or zombie 
> state upon completion. For example, top, when I tried to exit it, hung 
> for about a minute with Ctrl-T reporting:
> 
>     load: 0.13  cmd: top 85718 [pfault] 19.04r 0.00u 0.01s 0% 2532k
> 
> Why would a machine with so much free memory continue to act this way? 

The output you pasted shows that there is very little free memory.

> Is it yet to recover from the "out of swap" situation? I'm sure, a 
> reboot will fix everything, but I expected FreeBSD to be better than 
> that... Running 10.3-stable from April 18 here. Thanks!

There was a memory leak in CAM at that point. It's fixed in r299531, but
the vmstat output is needed to verify that this is the problem you're
hitting.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160608222440.GA28489>