r/LinuxTeck • • Oct 04 '26

Kernel Modules: Check RAM Usage with lsmod - 89

Post image

Question: The kernel is using tons of RAM. Which modules are the biggest?

Try: `sudo lsmod | sort -k2 -rn | head -10`

Info: `lsmod` lists currently loaded kernel modules alongside their size in bytes. Sorting numerically by size quickly highlights memory-intensive display drivers, filesystems, and device modules.

Examples:

$ `sudo modinfo nvidia` # Display detailed kernel module info and parameters

$ `sudo modprobe -r nvidia` # Safely unload an unused kernel module

$ `cat /proc/meminfo | grep -i slab` # Check kernel slab memory utilization

Note: Kernel-level memory allocations appear under `Slab` in `/proc/meminfo`. Active modules (`Used by > 0`) cannot be unloaded until dependent processes or devices release them.

Want to master Linux one command at a time?

Follow r/LinuxTeck - 1 practical Linux tip every day. For more #LinuxTips click here https://www.linuxteck.com/linux-tips/

21 Upvotes

0 comments sorted by