Date: Wed, 11 Jun 2008 18:36:24 +0200 (CEST) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-questions@FreeBSD.ORG, The Ghost <the-ghost@inbox.ru> Subject: Re: very strange reaction of the md disks Message-ID: <200806111636.m5BGaOa3062521@lurza.secnetix.de> In-Reply-To: <E1K3Qz3-000OTE-00.the-ghost-inbox-ru@f107.mail.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello, I don't know why nobody else has given the correct answer to this (it's should actually be a FAQ). So I'll try to give an answer. The Ghost <the-ghost@inbox.ru> wrote: > Hello, > > Maybe I just don't understand something, but anyway, it looks really odd. > > I have a machine with 2 Gb RAM with a clean newly-installed > FREEBSD-7.0-RELEASE. I make two 300-MB mdconfig disks and populate > them, and when the first one was already full and the second one is > only half-full, I get a kernel panic "not enough memory". Use "-t swap" with mdconfig(8), not "-t malloc". > [...] > I was very surprised to see that one gigabyte of my > memory suddenly became used up. FreeBSD uses all memory for caching, as far as possible. Free memory is wasted memory. > A friend of mine told me that such a panic is really a thing to write > a bugreport on it, No. It is clearly documented in the mdconfig(8) manpage: "If the -o reserve option is not set, creating and filling a large malloc-backed memory disk is a very easy way to panic a system." As I said above, you probably don't want a malloc-backed memory disk (which means it consumes non-pagable kernel memory), but a swap-backed disk (which is cached in regular RAM and backed by swap). If you're absolutely sure you want kernel-malloc for your memory disk, you need to increase the kmem limit (see "sysctl vm | grep kmem"). Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "To this day, many C programmers believe that 'strong typing' just means pounding extra hard on the keyboard." -- Peter van der Linden
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806111636.m5BGaOa3062521>