Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jun 2006 10:23:18 -0400
From:      Bill Moran <wmoran@collaborativefusion.com>
To:        Paul Schmehl <pauls@utdallas.edu>
Cc:        questions@FreeBSD.org
Subject:   Re: Running out of swap space????
Message-ID:  <20060606102318.6b4da83c.wmoran@collaborativefusion.com>
In-Reply-To: <44858D82.80500@utdallas.edu>
References:  <060620061251.3465.44857A490003444500000D89220076106408099A0E0B0B0703D20D010D@comcast.net> <1149598670.44857bce3f0b0@196.22.132.16> <44858D82.80500@utdallas.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 06 Jun 2006 09:13:22 -0500
Paul Schmehl <pauls@utdallas.edu> wrote:

> cknipe@savage.za.org wrote:
> > Quoting bob.middaugh@comcast.net:
> > 
> >>> -------------- Original message ----------------------
> >>> From: pauls@utdallas.edu
> >>> +pid 37308 (mysqld), uid 88, was killed: out of swap space
> >>> +swap_pager: out of swap space
> >>> +swap_pager_getswapspace(1): failed
> >>
> >> If you kill mysql server, does the swap space free up?  Are there any known
> >> issues between the version of MySQL that you're running and FreeBSD 6.0?
> > 
> > MySQL not having a properly tuned config file for the system it runs on?  It is
> > known to consume vast amounts of resources if not properly configured... 
> > 
> I wrote a one line shell script that runs swapinfo -h and cron'd it to 
> run once an hour.  Each hour the amount of swap space being used has 
> increased by 100 to 200 MB.  Eventually swap is exhausted and the system 
> kills a binary.  (It's not just mysql.  Other things are being killed as 
> well.)

This is typical.  I believe that the process killed is the one swapped out
the longest, or maybe it's random?  Either way, the one killed usually
isn't the one using all the memory.

> What would cause swap to increase steadily like that?  Something not 
> releasing swap when it's no longer needed?

One of two things:
1) You have misconfigured an application to think it has _way_ more memory
   available than it does, so it just keeps using more and more memory,
   because you told it that it was OK to do so.
2) You are running an application with a memory leak.  Meaning: it allocates
   memory, then loses track of said allocation and re-allocates it later.
   Since it lost track, it's no longer using the memory, but can't tell
   the kernel to release the memory for other applications to use either.
   This is a bug in the application, not FreeBSD.

If you provide the full output of top to the list, I'm sure some problem
will jump out for someone on the list.  Wait till the system is close to
having no swap, then do "top > somefile" and paste the file into your
mailer.

-- 
Bill Moran
Collaborative Fusion Inc.



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