From owner-freebsd-questions@FreeBSD.ORG Wed Jun 11 16:36:27 2008 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DD28106567F for ; Wed, 11 Jun 2008 16:36:27 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 817B88FC0A for ; Wed, 11 Jun 2008 16:36:26 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id m5BGaO3A062522; Wed, 11 Jun 2008 18:36:25 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id m5BGaOa3062521; Wed, 11 Jun 2008 18:36:24 +0200 (CEST) (envelope-from olli) Date: Wed, 11 Jun 2008 18:36:24 +0200 (CEST) Message-Id: <200806111636.m5BGaOa3062521@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG, The Ghost In-Reply-To: X-Newsgroups: list.freebsd-questions User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 11 Jun 2008 18:36:25 +0200 (CEST) Cc: Subject: Re: very strange reaction of the md disks X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@FreeBSD.ORG, The Ghost List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2008 16:36:27 -0000 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 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