From owner-freebsd-current Sun Apr 5 18:40:12 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA18977 for freebsd-current-outgoing; Sun, 5 Apr 1998 18:40:12 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA18798; Sun, 5 Apr 1998 18:39:56 -0700 (PDT) (envelope-from tlambert@usr04.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id SAA11575; Sun, 5 Apr 1998 18:39:55 -0700 (MST) Received: from usr04.primenet.com(206.165.6.204) via SMTP by smtp02.primenet.com, id smtpd011516; Sun Apr 5 18:39:45 1998 Received: (from tlambert@localhost) by usr04.primenet.com (8.8.5/8.8.5) id SAA10532; Sun, 5 Apr 1998 18:39:40 -0700 (MST) From: Terry Lambert Message-Id: <199804060139.SAA10532@usr04.primenet.com> Subject: Re: swap-leak in 2.2.5 ? To: dswartz@druber.com (Dan Swartzendruber) Date: Mon, 6 Apr 1998 01:39:40 +0000 (GMT) Cc: dyson@FreeBSD.ORG, dg@root.com, dag-erli@ifi.uio.no, stable@FreeBSD.ORG, current@FreeBSD.ORG In-Reply-To: <3.0.5.32.19980405182046.009137d0@mail.kersur.net> from "Dan Swartzendruber" at Apr 5, 98 06:20:46 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >> My only quibble with this technique is that it would seem to make it > >> harder to tell if your machine is really running low on swap or not > >> (e.g. swap as backing store for stack/heap/whatever *is* critical and > >> allocation failure can cause application failure, whereas swap being > >> used to cache random cruft is in the "who really cares" department). > >> Or is there some way to tell the difference? > >> > >It is difficult not only to tell if you are low on swap, but also it > >is hard to quantify being low on memory. I have been thinking about > >this over the last year or so. > > It was actually kind of embarrassing. I convinced a local ISP to start > converting their servers from Linux (what I recommended a few years ago > when I didn't know different :)) One of the admins (who has some Linux > experience) asked me why it was using swap. I gave the canonical reply. > He asked the question I just posed. I had no good reply :( I've been thinking about this as well. I think it should be relatively easy to (ab)use procfs and /dev/kmem to get at what pages are allocated to processes, which ones are clean, and so on. Procfs might need extended, but so what? This info is available from the SVR4 procfs; I used a simple "RLE" representation to find out that if you reference page zero on SVR4, instead of blowing up, it maps a zero-filled page in there. Bletch! I was considering writing a graphical tool to display this; maybe this will be my first real excuse to forray into AWT and JNI. Hopefully someone will beat me to this; I'm not terribly motivated to get that deep into AWT without some guarantee of a commercially usable JVM on FreeBSD. Kaffe is partly there, but you are still screwed by the non-public Sun "classes.zip". The base design I had in mind was a 128x128 (yes, limited to 64M) display of 4k page allocations, with the ability to "magnify" the grid to the point where you can see PID's (or 'shared'). Colors whould show mapping status (read-only, write-only, execute-only [if the bit were maintained; Intel is stupid], copy-on-write, text, data, kernel, and shared library, and clean [cached, unused]). Probably alternate mappings would be hand for "topographic" coloring based on number of mappings, number of aliases, etc.. Be quite a cool toy if I ever get around to writing it. ;-). I'm currently downloading the Mozilla source... I expect it to keep me busy for a while. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message