Skip site navigation (1)Skip section navigation (2)
Date:      6 Feb 1999 04:25:14 +1100
From:      "John Saunders" <john.saunders@nlc.net.au>
To:        Brian Feldman <green@unixhelp.org>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: swapper BIG problems
Message-ID:  <19990205172514.15774.qmail@nhj.nlc.net.au>
In-Reply-To: <Pine.BSF.4.05.9902050756100.1044-100000@janus.syracuse.net>

next in thread | previous in thread | raw e-mail | index | archive | help
In nlc.lists.freebsd-current you wrote:
> If you looked at the "prgram" (term used loosely) it touches every bit of
> memory it allocates.

I seemed to have overlooked the bit where you wrote deadbeef. I took a
closer look.

What I think is happening is that as the blocks are allocated and then
touched, physical RAM is allocated. As you continue the oldest touched
blocks get allocated to swap to make RAM available for touching new pages.
You will reach a stage where you fill all of swap _and_ all of the free
RAM pages.

It's very likely that some part of your code hasn't been paged into RAM
yet. But when it does need to there are no free RAM pages. When the
swapper tries to make some free RAM pages by swapping out, guess what no
swap available.

> The pages were already touched and in swap. After each page was read in by
> the pager, the printf() tried to malloc but generated the error (as it seems
> to me).

Maybe not tried to malloc, but simply for the shared library or some part
of your code to be paged in for execution.

This is a hard problem to fix reliably. However try limiting the max
memory size (ulimit -m xxx). I believe this should limit the resident
set size (RSS) for the process, therefore it will fail to allocate more
memory before all of available RAM is allocated.

Cheers.
--            +------------------------------------------------------------+
        .     | John Saunders  - mailto:john@nlc.net.au            (EMail) |
    ,--_|\    |                - http://www.nlc.net.au/              (WWW) |
   /  Oz  \   |                - 02-9489-4932 or 041-822-3814      (Phone) |
   \_,--\_/   | NHJ NORTHLINK COMMUNICATIONS - Supplying a professional,   |
         v    | and above all friendly, internet connection service.       |
              +------------------------------------------------------------+

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



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