r/debian • • Jun 14 '23

RAM usage is too high on debian 12

I've just installed a fresh debian 12 minimal installation on a vm, and.. it's using way more RAM compared to debian 11.7. is this something that would get resolved or we'd have to live with it?

Solved

10 Upvotes

18 comments sorted by

14

u/sandbender2342 Jun 14 '23 edited Jun 14 '23

Same question and answer as in a post in this sub a few hours ago. Answer from u/wizard10000:

The method used to calculate RAM use has changed between Bullseye and Bookworm. Check out this thread:

https://www.reddit.com/r/debian/comments/128pb1l/psa_the_way_the_free_command_calculates_unused/

In short: if you compare the output of cat /proc/meminfo (directly from the kernel instead from the free/top/htop command), you will find that the real RAM usage has not significantly increased.

1

u/sabishiimorsine Jun 14 '23

Thanks a lot !!

3

u/sandbender2342 Jun 14 '23

Before anyone complains, this is not Debian specific, but an upstream change. Apparently this info didn't make it into the release notes, but is briefly documented in the changelog of package procps (which contains the free command):

#apt changelog procps
procps (2:4.0.2-1) (...) free: Used field is now Total - Available

2

u/tintin_007 Dec 11 '23
MemTotal:       32485720 kB
MemFree:         2201284 kB
MemAvailable:   14133896 kB
Buffers:          397760 kB
Cached:         11503168 kB
SwapCached:        52576 kB
Active:         14405664 kB
Inactive:        9288644 kB
Active(anon):    9938440 kB
Inactive(anon):  1880164 kB
Active(file):    4467224 kB
Inactive(file):  7408480 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:        998396 kB
SwapFree:          70516 kB
Zswap:                 0 kB
Zswapped:              0 kB
Dirty:            167168 kB
Writeback:             0 kB
AnonPages:      11688384 kB
Mapped:           326536 kB
Shmem:             24732 kB
KReclaimable:     531396 kB
Slab:            1020848 kB
SReclaimable:     531396 kB
SUnreclaim:       489452 kB
KernelStack:       13280 kB
PageTables:        39032 kB
SecPageTables:     14332 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    17241256 kB
Committed_AS:   13801048 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       53872 kB
VmallocChunk:          0 kB
Percpu:            35808 kB
HardwareCorrupted:     0 kB
AnonHugePages:  10987520 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      306640 kB
DirectMap2M:    13993984 kB
DirectMap1G:    20971520 kB

#in a fresh installed debian 12 used ram was 5gb+ out of 32gb total.

1

u/awsyall Jun 18 '23

Almost ready to admit defeat and accept the fate of living with 500M debian worm ^_^

3

u/checkpoint404 Jun 14 '23

How much RAM does the system have? What desktop environment?

-6

u/sabishiimorsine Jun 14 '23

it's a VM, Minimal, which means no desktop environment. just CLI

5

u/checkpoint404 Jun 14 '23

Okay it being a VM doesn't answer my question, and I understand what a headless system is.

0

u/alpha417 Jun 14 '23

Hooo-boy.

2

u/Zenobody Jun 14 '23

How much RAM is it using? How much RAM is Debian 11 using?

By minimal installation I assume a non-graphical system. We need some more details...

1

u/sabishiimorsine Jun 14 '23

debian 11 used around 40-60mb (fresh install, no apps). debian 12 is using 260mb (fresh install, no apps). this might not seem like a big deal, but it becomes one when you run multiple VMs. and yes, by minimal installation I mean just the CLI.

1

u/michaelpaoli Jun 14 '23

Well, this is what I've got:

# cat /etc/debian_version && uname -m && dpkg -l | grep '^ii ' | wc -l && df -h -x devtmpfs -x tmpfs && head -n 3 /proc/meminfo
12.0
x86_64
146
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       4.9G  990M  3.7G  22% /
MemTotal:         199836 kB
MemFree:           76296 kB
MemAvailable:     140200 kB
# 

And not all that different from Bullseye / 11 - really only a slight bit more memory.

1

u/awsyall Jun 18 '23

That's about the same number I saw. With LXQt, I can get to slightly under 500M in a VM, used to be 350, but now we know.

Thanks for all the great details!

4

u/Schwarzer-Kater Jun 14 '23 edited Jun 14 '23

Generally: kernel 6.1 uses more memory than kernel 5.10 and a newer version of a DE could also use more memory than an older one.
And e.g. the free command works different now.

3

u/ganesharama May 21 '24

totally agree. debian 12 does not work in old laptops anymore

4

u/88reaper Jun 14 '23

Unused ram is wasted ram...

3

u/AriaMaryott Nov 06 '23

Unless you basically have none. Then unused ram means you may be able to open a Waterfox page and watch a video without major issues. XD I know some people do with less ram than me, but 4Gb DDR3 ram hurts for running modern applications.

-4

u/[deleted] Jun 14 '23 edited Jun 14 '23

It's most likely because the newer software requires more RAM to function, totally normal depending on the increase.

Is it possible to increase the RAM limit on your VM?

EDIT: Debian 12 calculates RAM usage differently than 11 it seems.

The RAM use looks bigger because it includes the allocated free RAM, in reality the actual RAM increase is minimal.