You are not logged in.

#1 2007-08-09 09:06:17

Benedict_White
Member
From: Sussex, UK
Registered: 2004-05-27
Posts: 331
Website

Memory leak on samba server

I have a server running Samba, bind, dhcp, cups and MySQL.

I have noticed that over a day the memory in use gradually grows, with the swap file growing and growing, but in cache only.

Then physical rams runs ow, and the server slows down. A reboot speeds it up.

Howver the memory is never cleared down when people log off and go home.

I can's as yet seem to identify what is taking up the ram. (2GB)

Any thoughts?


Kind regards

Benedict White

Offline

#2 2007-08-09 13:51:41

oliv
Member
Registered: 2005-04-17
Posts: 58

Re: Memory leak on samba server

I had the same issue, and I through it was a memory leak until....
... I discovered it was not an issue. I'll give you more details when I go back home if you want. I classified it as 'normal behaviour' since the kernel 2.6.~20 but maybe I miss something.

It has something to do with shm. Shared memory filesystem that takes as much memory as available, and free memory when requested.

I have only samba, cups and mysql. All I know is that mysql takes 100MB + 100MB cache.

Are you sure that your server slow down ?

Offline

#3 2007-08-09 13:59:47

Benedict_White
Member
From: Sussex, UK
Registered: 2004-05-27
Posts: 331
Website

Re: Memory leak on samba server

Hmm.. Well, yes I am sure the server slows down quite a lot, in terms of file access.

That said I note what you say about the kernel version and memory management.

I would appreaciate more details when you get home if you have them.

Also, the process takes about a day on my server, slowly filling up the memory as performance degrades.


Kind regards

Benedict White

Offline

#4 2007-08-09 18:52:01

oliv
Member
Registered: 2005-04-17
Posts: 58

Re: Memory leak on samba server

Ok, so here is the thing on my box.

During the installation of ArchLinux, I used the standard /etc/fstab which contains :

none                   /dev/shm      tmpfs     defaults               0      0

So now when I check mounted partitions :

# df -H
/dev/hda8               16G   6,5G   8,3G  44% /
none                   1,1G      0   1,1G   0% /dev/shm
/dev/hda7               16G    11G   4,1G  73% /home

Here you can see that /dev/shm is a 1.1G sized tmpfs partition.
tmpfs is a file system used for in memory temporary files. Access to such files is very quick, and they are definitively lost when you power down your computer.

But tmpfs takes ram, tmpfs takes many ram, and tmpfs takes as much ram as he wants. tmpfs put directly its memory in swap, but it should be cached swap because you have 2G RAM. Check your memory usage with 'top'. It should display a lot of cached swap.

So tmpfs is used by some programs (I don't know any but I heard there are some). You can check fs usage with df and check the content of /dev/shm directory.

Resolution:
You should keep tmpfs for performance of some programs.
I don't remember what I've done but the size of tmpfs don't match my memory usage.
It seems you can gives tmpfs a size in fstab but I never tried.

none                   /dev/shm      tmpfs     defaults,size=512M               0      0

Correct me if I'm wrong.

I hope it will help you.

Last edited by oliv (2007-08-09 18:57:36)

Offline

Board footer

Powered by FluxBB