Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jan 2005 17:07:32 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        dkouroun@cc.uoi.gr
Cc:        freebsd-questions@freebsd.org
Subject:   Re: having 1.5GB RAM I cannot allocate more than 512MB RAM in 4.10
Message-ID:  <20050130150732.GA63409@gothmog.gr>
In-Reply-To: <1107067917.41fc840d574dd@webmail.uoi.gr>
References:  <20050129120037.2E16A16A4D3@hub.freebsd.org> <1107027374.41fbe5ae47d36@webmail.uoi.gr> <41FC6144.90405@incubus.de> <1107067917.41fc840d574dd@webmail.uoi.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-01-30 08:51, dkouroun@cc.uoi.gr wrote:
>
> Guys thanks for the help but it doesn't want to work!

Actually, it works, but you are limited by the maximum allowable data
size of the VM system.

> Infact my data size setting in /etc/login.conf is unlimited by
> default.

True, but this won't work.  Even if you set datasize to a large number
of bytes, i.e. 8589934592 (800 MB), you are limited by the internal
kernel limit for the maximum data size.

This is defined in /usr/src/sys/i386/include/vmparam.h as:

    #define        MAXDSIZ         (512UL*1024*1024)       /* max data size */

When the setting of login.conf is applied, the following code runs from
`src/sys/kern/kern_resource.c' (the implementation of the setrlimit(2)
syscall):

    int
    kern_setrlimit(td, which, limp)
            struct thread *td;
            u_int which;
            struct rlimit *limp;
    {
            [...]
            case RLIMIT_DATA:
                    if (limp->rlim_cur > maxdsiz)
                            limp->rlim_cur = maxdsiz;
                    if (limp->rlim_max > maxdsiz)
                            limp->rlim_max = maxdsiz;
                    break;

Thus, the maximum data segment size is limited by the value of
`maxdsiz'.  The `maxdsiz' limit is tunable at boot time, by setting the
"kern.maxdsiz" option in your `/boot/loader.conf' file.

- Giorgos



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050130150732.GA63409>