Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New "free -m" output, how to interpret?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

New "free -m" output, how to interpret?

As you many know in a recent change of "free" you now see a different value for "free" in cached/buffered (that was deleted). More info here https://askubuntu.com/questions/770108/what-do-the-changes-in-free-output-from-14-04-to-16-04-mean

The question is why on Italy NAT 128MB (using old "free") vs UK NAT 128MB (using new "free") with the same setup and OS I get 120MB free RAM under -/+ buffers/cache on the first while on the other I get "available" (that's is supposted to be the equivalent of -/+ buffers/cache) of like 70MB? What is the real RAM usage at this point? I'm running exactly the same processes on both...

«1

Comments

  • screen shot please?

  • sandrosandro Member
    edited September 2017

    Sorry didn't have access before.

    What was the markdown syntax for code?

  • found!

    new free

    root@server3:~# free -m
                  total        used        free      shared  buff/cache   available
    Mem:            128          16          80           5          31          77
    Swap:             0           0           0
    
    

    old free

    root@server2:~# free -m
                 total       used       free     shared    buffers     cached
    Mem:           128         59         68         66          0         54
    -/+ buffers/cache:          4        123
    Swap:            0          0          0
    
  • AnthonySmithAnthonySmith Member, Patron Provider

    Well its not the same setup and OS (as in an exact match) if one has the old 'free' and one has the new.

    Something is slightly different unless you JUST updated 'free' which seems unlikely.

    You probably just update/upgraded one of them and have a load in cache as a result, reboot both then run the same test, also give the output of 'top -b -n1'

    Thanked by 1ehab
  • raindog308raindog308 Administrator, Veteran

    God I hate Linux. Change for change's sake,

    Thanked by 2Aidan default
  • fhnericfhneric Member
    edited September 2017

    @raindog308 said:
    God I hate Linux. Change for change's sake,

    All operating systems change. Just look at macOS and Windows 10.

  • WSSWSS Member
    edited September 2017

    @raindog308 said:
    God I hate Linux.

    Yep. More useful information is under /proc/meminfo since 2.x anyhow.

    MemTotal:        8117112 kB
    MemFree:         6185840 kB
    MemAvailable:    6520052 kB
    
    Thanked by 1Janevski
  • leapswitchleapswitch Patron Provider, Veteran

    One is CentOS 6 and the other is CentOS 7? Hostname is different in both.

  • raindog308raindog308 Administrator, Veteran

    fhneric said: All operating systems change. Just look at macOS and Windows 10.

    Sure, but they change in search of some improvement. Sometimes good, sometimes bad, but it's always a tangible change.

    Linux just changes for change's sake. This free change is purely cosmetic.

    What info is in the new free that isn't in the old? What justifies breaking people's scripts? I guess free(1) isn't in POSIX because then Linux would have to behave in an adult fashion and wouldn't be allowed to make willy nilly changes.

    BTW, what do you want to bet there's no mention of this in the distro release notes? Heck, with Linux you're lucky if there's even a man page...

    Thanked by 2bugrakoc Amitz
  • Sorry my bad it's 14.04 vs 16.04 but is that the reason? Again if I look at "available" like that site says, now that I rebooted it shows 7MB left... mmh? I'll post more details when I go home.

  • That just means "unused". Learn to Linux.

  • For the new display, basically

    Free: completely unused memory, contributing nothing to system performance but consuming power.

    Available: memory that can be used to run processes.

  • I'm starting to think the previous version was wrong. How is it possible, OS+mysql+php+nginx using only 4MB?

  • AnthonySmithAnthonySmith Member, Patron Provider

    if they are both LES its probably because I spent time creating the 14.x template and trimming it down to almost nothing, 16.x will just be vanilla openvz.

    But either way, different OS's different packages, dont expect the same results.

  • @AnthonySmith said:
    if they are both LES its probably because I spent time creating the 14.x template and trimming it down to almost nothing, 16.x will just be vanilla openvz.

    But either way, different OS's different packages, dont expect the same results.

    OK but it is reasonable all that for 4MB?

  • JanevskiJanevski Member
    edited September 2017

    It's quite simple actually - Linux ram is a lot like a bus.

    On the first stop 7 people enter, on the second 9 leave and on the third 2 should enter for the bus to be completely empty.

  • defaultdefault Veteran
    edited September 2017

    @Janevski said:
    It's quite simple actually - Linux ram is a lot like a bus.

    On the first stop 7 people enter, on the second 9 leave and on the third 2 should enter for the bus to be completely empty.

    & RAM is full...

    Thanked by 1netomx
  • AnthonySmithAnthonySmith Member, Patron Provider

    sandro said: OK but it is reasonable all that for 4MB?

    yeah if its not actually doing anything.

  • @sandro said: As you many know in a recent change of "free" you now see a different value for "free" in cached/buffered (that was deleted). More info here https://askubuntu.com/questions/770108/what-do-the-changes-in-free-output-from-14-04-to-16-04-mean

    Abstracting away from your particular situation, did you read/study the (highly rated) reply given at this link?

  • @sandro: There are also other ways to check memory usage. In addition to cat /proc/meminfo (@WSS's suggestion), you can use top or htop, not to mention vmstat -s.

  • @raindog308 said: What info is in the new free that isn't in the old? What justifies breaking people's scripts? I guess free(1) isn't in POSIX because then Linux would have to behave in an adult fashion and wouldn't be allowed to make willy nilly changes.

    BTW, what do you want to bet there's no mention of this in the distro release notes? Heck, with Linux you're lucky if there's even a man page...

    Well, free is part of the package procps-ng, so it's rather the latter that was officially updated. As for mentioning this particular change in free, well, this may be too much to expect from the overworked maintainers of an ordinary Linux distribution (who simply update procps-ng with all of the other packages).

    But Red Hat does say something:

    https://access.redhat.com/solutions/406773

    In any case, free is originally a Linux command. It has been ported to *BSD, but in NetBSD, for example, it's not included in the base distribution.

    As for the man page for free, it's been updated, and the latest version of the man page from 2016 clearly describes the behavior of the updated version of free:

    http://man7.org/linux/man-pages/man1/free.1.html

  • Just use htop, much more readable, understandable and meaningful tool

  • It's 7012 and we should use free -h for human readable format instead of dividing and modding with 1024.

  • sandrosandro Member
    edited September 2017

    @mehargags said:
    Just use htop, much more readable, understandable and meaningful tool

    It's even more confusing, it says 168/128 while free shows 95 used and 8 available. Anyway I may be stupid apparently but I still don't understand how much RAM I have left for new processes to use. And How the hell is possible the OS can use 4MB for the "same" things while on other unoptimized system 90MB.

  • @sandro said:
    It's even more confusing, it says 168/128 while free shows 95 used and 8 available. Anyway I may be stupid apparently but I still don't understand how much RAM I have left for new processes to use. And How the hell is possible the OS can use 4MB for the "same" things while on other unoptimized system 90MB.

    Yeah, you don't understand how this works. OpenVZ runs under the host kernel- most of what you have running is basically just for your sub-processes on the host. That's why there's so little RAM used compared to a KVM, LXC, or other similar virtualizations.

  • @WSS said:

    @sandro said:
    It's even more confusing, it says 168/128 while free shows 95 used and 8 available. Anyway I may be stupid apparently but I still don't understand how much RAM I have left for new processes to use. And How the hell is possible the OS can use 4MB for the "same" things while on other unoptimized system 90MB.

    Yeah, you don't understand how this works. OpenVZ runs under the host kernel- most of what you have running is basically just for your sub-processes on the host. That's why there's so little RAM used compared to a KVM, LXC, or other similar virtualizations.

    And probably something else is different on 16.04 since compared to 14.04 top, htop and free all show different things now. Different versions maybe.

  • Well, 14.04 was upstart, and 16.04 is systemd, so beyond the kernel itself, the entire init system is different. They're not really the same beast. Linux likes to change everything without reason every few daysyears. If you want something cohesive that won't change much, you want a BSD.

  • @WSS said:
    Linux likes to change everything without reason every few daysyears.

    Doesn't every geek have make-work projects?? :)

  • Oh yeah I installed htop 2 on the old machine and they know show the same ram usage... I'm now confused because I don't basically know how much RAM can the system actually use if needed...
    And this is not a good reference anymore of ram -used- using free on openVZ: https://lowendbox.com/blog/yes-you-can-run-18-static-sites-on-a-64mb-link-1-vps/

Sign In or Register to comment.