Remove Sound Modules

Hi.

This is not a webmin / virtualmin related question. So anyone can chip in.

I saw that these modules are taking an incredible amount of memory on my web server. Should i … and Could i remove these at boot ?

snd_intel8x0 33897
snd_ac97_codec 63889
snd_pcm_oss 49017
snd_mixer_oss 17985
snd_pcm 96841
snd_timer 29893
snd_page_alloc 9673
snd_mpu401_uart 8769
snd_rawmidi 26597
snd_seq_device 8137
snd 55461
soundcore 9889

And if so, HOW ? Google is no help at all.

Faisal.

Hi.

Yeah, but somehow i have only 96 MB left on a machine with 512MB of RAM :(. So thats kind of ticking me off. What the heck is eating up so much memory.

Faisal.

Hey Faisal,

That’s normal. In fact, I’d expect less free on a working machine with 512MB. I’ll tell you why: buffer/cache.

The Linux kernel is very aggressive about caching disk data in RAM in order to improve performance, so it only keeps a few MB free, while devoting any extra memory to the buffer/cache. You can see this in top, by looking at the buffers and cached fields. "buffers" is disk I/O buffers, while "cached" is swap data that is also in memory. The former speeds disk limited tasks, while the latter tells you want is in swap and also cached in memory (also a performance thing).

Both buffers and cache are generally safe to consider "available" memory, and can be freed instantly by the kernel when needed.

In other words, your total available memory is free+buffers+cached.

Now, if this totals up to only 96MB, then we might have a problem, and you should post the output of a "ps -auxc" so we can see where memory is going.

You can see it in a nicely formatted table with "top". Hit "M" (not that it is uppercase) to sort by memory usage.

I was surprised by this when i first started running linux, my servers typically only have 5-10% of the available ram listed as “free”, but i’ve never had performance problems.

Hi.

Awesome Answer. Makes perfect sense. Yes, with buffer + Free memory i have like 50 % free :slight_smile: … Thanks Joe.

Hey Faisal,

“Incredible amount of memory” is in the eye of the beholder…that doesn’t look like a lot of memory to me. It totals up to 410048 or about 410 kilobytes…not even 1 MB. That’s probably one httpd child process (maybe not even that many…my eight httpd processes are consuming 11MB right now, so that seems to indicate that each one is greater than 1MB). 410K is nothing to worry overly much about. But…

Removing them is easy. It’s a two-parter, but I think this will stop all sound modules from being loaded.

First up, if the system is a kernel 2.6 based system or another system equipped with ALSA, configure alsasound not to start on boot:

chkconfig --level 345 alsasound off

And stop it now:

service alsasound stop

Next up, to prevent auto-loading of the modules (I don’t know if this is needed if the above is done, but it won’t hurt to do it anyway). Edit /etc/modprobe.conf, and comment out or all of the snd-related entries. Mine looks like this:

alias snd-card-0 snd-ice1712
options snd-card-0 index=0
install snd-ice1712 /sbin/modprobe --ignore-install snd-ice1712 && /usr/sbin/alsactl restore]/dev/null 2>&1 || :
remove snd-ice1712 { /usr/sbin/alsactl store]/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-ice1712

Added for a virtual midi controller?

alias sound-service-0-1 snd-seq-oss
alias sound-service-0-8 snd-seq-oss
#alias sound-slot-1 snd-card-1
#alias snd-card-1 snd-virmidi
alias sound-slot-1 snd-card-1
alias snd-card-1 snd-usb-audio
options snd-usb-audio snd_index=1

I have a complicated sound setup on my home machine, for my long-neglected music and audio hobby, so yours will probably only be three or four lines compared to my dozen or so.

And, of course you can use modprobe to remove them right now (though I don’t know if unloaded kernel modules actually return memory to user space–I seem to recall they don’t):

modprobe -r snd_intel8x0

But you’ll have to remove them in their order of dependency, which can be tricky.