Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 May 2007 14:28:19 -0400
From:      Kris Kennaway <>
To:        Kevin Downey <>
Cc:        " List" <>
Subject:   Re: mdconfig -t malloc limits
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Mon, May 14, 2007 at 12:12:23AM -0700, Kevin Downey wrote:
> On 5/14/07, Kris Kennaway <> wrote:
> >On Sun, May 13, 2007 at 09:34:46PM -0700, Kevin Downey wrote:
> >> I am building a shiny new desktop, the only thing I don't have right
> >> now is the hard drive, so
> >> I have been booting a minimal system off a flash drive. The box has
> >> two gigs of ram. if I try to create a malloc backed md device bigger
> >> then 300mb(this is not the exact limit but it is between 300mb and
> >> 400mb) it fails. If I use -o reserve the mdconfig command fails and if
> >> I don't then when I try and use that space FreeBSD crashes. It seems
> >> like there should be enough unused memory to create a 1gb malloc
> >> backed md.
> >>
> >> I have no swap because the only drive is a flash drive.
> >> / is  mounted read only.
> >> /tmp and /var are 124mb malloc backed md devices
> >>
> >> What is the deal? Is this some tunable limit? Should I fire up memtest?
> >
> >See the manpage, or the archives for extensive discussion.  Bottom
> >line: you almost certain don't want to use malloc backing, but instead
> >swap backing.
> >
> >Kris
> >
> using:
> mdconfig -a -t swap -s 500m -o reserve
> I get:
> mdconfig: ioctl(/dev/mdctl): Numerical argument out of domain
> in fact I get the same message no matter what size I pick.
> I had assumed that since I don't have a swap partition setup that
> using a backing method called 'swap' wasn't a good idea.

The issue is only using -o reserve, which will try to reserve space on
the swap backing.

If you absolutely have to run without swap, you will indeed have to
use malloc backing with -o reserve.  This is slower than swap backing,
and you'll have to increase your VM_KMEM_SIZE to allocate enough extra
memory to the kernel (leaving space for the rest of the kernel to
operate).  Recall that all the memory you allocate to your md will be
unavailable for processes or the rest of the kernel, so it is a bad
idea to use more than you absolutely need.


Want to link to this message? Use this URL: <>