Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Sep 2000 14:30:31 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Agent Drek <drek@bigstudios.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: really 'big' smbd
Message-ID:  <20000907143031.J18862@fw.wintelcom.net>
In-Reply-To: <Pine.BSF.4.21.0009071706120.60371-100000@hops.bigstudios.com>; from drek@bigstudios.com on Thu, Sep 07, 2000 at 05:10:22PM -0400
References:  <20000907103123.E18862@fw.wintelcom.net> <Pine.BSF.4.21.0009071706120.60371-100000@hops.bigstudios.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Agent Drek <drek@bigstudios.com> [000907 14:13] wrote:
> On Thu, 7 Sep 2000, Alfred Perlstein wrote:
> 
> > * Agent Drek <drek@bigstudios.com> [000907 10:23] wrote:
> > > hey there,
> > > 
> > > I looking to find out what's going on with my server. under constant usage
> > > of samba throughout the day it will run out of swap. There is very little
> > > samba activity it's just that it seems to be caching every request in
> > > memory/swap . eventually everything overflows. I've asked for help on the
> > > samba lists but AFAIK other people with the same version of samba do
> > > not experience this problem ... so it's my bad somewhere with the OS
> > > I think.
> > 
> > You may want to try running 'limit' to limit the memory size before
> > starting smbd.
> > 
> > -Alfred
> > 
> 
> limit seems to be csh only via setrlimit which says that it will just
> segfault the offending process when it tries to get too big. I'm not
> sure that this is the solution I'm looking for ,,, maybe it is ... I'm
> just scared to try it without knowing more ...
> 
> could you elaborate on your suggestion?

no, how about trying my suggestion?

~ % cat t.c

#include <stdio.h>

int main(void) {
        int     x;
        printf("enter number of bytes to allocate");
        scanf("%d", &x);
        printf("allocating %d bytes...\n", x);
        if (malloc(x * sizeof(char)) == NULL)
                perror("malloc");
        else
                printf("ok.\n");

}
~ % limit
cputime         unlimited
filesize        unlimited
datasize        512kB
stacksize       64MB
coredumpsize    unlimited
memoryuse       512kB
memorylocked    unlimited
maxproc         4115
descriptors     8232
sockbufsize     unlimited
~ % ./a.out 
enter number of bytes to allocate300000
allocating 300000 bytes...
ok.
~ % ./a.out 
enter number of bytes to allocate513000
allocating 513000 bytes...
malloc: Cannot allocate memory


If smbd can't handle running out of memory then that's a smbd bug.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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