Subject: Re: qemu and "Could not allocate physical memory"
To: Joel CARNAT <>
From: Lubomir Sedlacik <>
List: netbsd-users
Date: 09/26/2005 11:59:39
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Sep 26, 2005 at 11:19:54AM +0200, Joel CARNAT wrote:
> I'm trying to get qemu use more than 64Mbits of RAM (with 3.0_BETA and
> 3.99.8, both i386, and 512Mo of RAM). Google points me to ulimit but
> it doesn't seem to be my problem (my bash has ulimit=3Dunlimited, and
> running qemu as root isn't better).
> I noticed some value in sysctl :
> proc.curproc.rlimit.datasize.soft =3D 134217728
> proc.curproc.rlimit.datasize.hard =3D 1073741824
> proc.curproc.rlimit.datasize.soft looks like the one than has to be
> modified. I tried doing so :
> # sudo sysctl -w proc.curproc.rlimit.datasize.soft=3D0
> proc.curproc.rlimit.datasize.soft: 134217728 -> 0
> # sudo sysctl -w proc.curproc.rlimit.datasize.soft=3D536870912
> proc.curproc.rlimit.datasize.soft: 134217728 -> 536870912

you are raising limits for the sysctl(8) process itself.

> each time, it goes back to it's initial value...
> so :
> 1. any trick to have qemu use 128Mo or 256Mo ?

you need to raise the limits for the shell executing qemu.  use
ulimit/limit commands of your shell to change datasize soft limit (e.g.,
for bourne style shells: ulimit -d).

> 2. any trick to modify datasize.soft, if it's the solution to my pb ?

you need to change proc.$pid_of_the_process.rlimit.datasize.soft, not
proc.curproc.rlimit.datasize.soft.  see also sysctl(8):



     To redirect core dumps to the /var/tmp/<username> directory,
           sysctl -w proc.$$.corename=3D/var/tmp/%u/%n.core
     should be used.
           sysctl -w proc.curproc.corename=3D/var/tmp/%u/%n.core
     changes the value for the sysctl process itself, and will not have
     the desired effect.


-- Lubomir Sedlacik <salo@{NetBSD,Xtrmntr,silcnet}.org>   --

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.6 (NetBSD)