LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   Slackware on the Raspberry Pi is a Memory Hog?!? (https://www.linuxquestions.org/questions/slackware-arm-108/slackware-on-the-raspberry-pi-is-a-memory-hog-4175494426/)

haziz 02-10-2014 07:56 AM

Slackware on the Raspberry Pi is a Memory Hog?!?
 
I installed Slackware 14.1 on my Raspberry Pi (512 meg RAM) using these instructions. To my surprise the memory footprint of it booting into the CLI is approximately 360 megs (determined using "free"). Even my x86 install on my laptop uses less memory (also a 32 bit 14.1 install). Raspbian and Arch on the same Pi use < 100 megs for a CLI boot. I think of Slackware as a lean, mean computing machine, which is why this surprised me.

So why is it this much of a memory hog? Inefficient distribution of RAM to the Framebuffer/GPU? Daemons starting at boot? If that is the case why is my x86 utilizing less memory?

On a side note, is the kernel for Slackware compiled for a hard or soft float?

I love Slackware immensely and will continue to use it on the Raspberry Pi, I am just curious.

enine 02-10-2014 09:44 AM

Check some of the answers on my post http://www.linuxquestions.org/questi...pi-4175492466/

Seems it will run on the PI but is not optimized for it. I tried a minimal install and had all kinds of problems until I started over with a full install. I got mine running fine but started stressing it and eventually it went in the weeds for a few hours and I killed power when I got home and that corrupted the drive so I need to install again.

Darth Vader 02-10-2014 10:18 AM

Quote:

Originally Posted by haziz (Post 5114940)
I installed Slackware 14.1 on my Raspberry Pi (512 meg RAM) using these instructions. To my surprise the memory footprint of it booting into the CLI is approximately 360 megs (determined using "free"). Even my x86 install on my laptop uses less memory (also a 32 bit 14.1 install). Raspbian and Arch on the same Pi use < 100 megs for a CLI boot. I think of Slackware as a lean, mean computing machine, which is why this surprised me.

So why is it this much of a memory hog? Inefficient distribution of RAM to the Framebuffer/GPU? Daemons starting at boot? If that is the case why is my x86 utilizing less memory?

On a side note, is the kernel for Slackware compiled for a hard or soft float?

I love Slackware immensely and will continue to use it on the Raspberry Pi, I am just curious.

Something is wrong with your setup...

Because I use SlackwareARM 14.1 (also) in a 10" WonderMedia 8650 (ARMv5TE) netbook, sporting just 256MB RAM. Still, my setup having a full install (excluding KDE, KDEI) and it run nice and responsive under X.org, using XFCE4 as DE.

So, I can't claim that Slackware-ARM is a Memory Hog. :hattip:

TobiSGD 02-10-2014 10:22 AM

Have you checked with top or htop which process is using that much memory? Also, what exactly does free report?

haziz 02-10-2014 12:58 PM

Quote:

Originally Posted by TobiSGD (Post 5115000)
Have you checked with top or htop which process is using that much memory? Also, what exactly does free report?

Not yet but I will. The RAM is shared between the GPU and CPU. I wonder if a good chunk is being reserved for the GPU. There are ways to adjust that with the other distros. I am mostly using Slack from the command line and don't need fancy graphics.

louigi600 02-10-2014 01:11 PM

Right after boot my Pi has 120Mb used most of which is cache and buffers ... the real usage is less then 20Mb. If I then start X with fluxbox window manager real usage rises to 25Mb.
Unfortunately I'm editing from my AC100 and cut and paste does not work from xterm ... otherwise I'd post the output of free to show the mem usage of my Pi.

I'm just guessing: you have enabled tmpfs in fstab that by default will use 50% of the available ram.

TobiSGD 02-11-2014 08:21 AM

Quote:

Originally Posted by louigi600 (Post 5115090)
I'm just guessing: you have enabled tmpfs in fstab that by default will use 50% of the available ram.

No, it will not. The 50% default is the limit how much it can use. tmpfs will only use as much RAM as it needs to store the data, if you only have a 1MB file on a tmpfs it will only use 1MB.

louigi600 02-11-2014 11:25 AM

That's true but depending on what you do with the tmpfs it can happen that it gets used to something close to the default maximum allowed.
I've seen that happen on my printserver running on a seagate dockstar from readoly filesystem where all the stuff that needs to be written ends up in tmpfs. But it was just a guess with out having the output of free or /proc/meminfo ... ina nay case there is something odd with that system: my Pi is not on right now but I've handy my hedless salvaged tablet with a very similar setup to my Pi (practically the same packages installed and same amount of ram) and here is what it has to say about memory usage

Code:

root@headless:~# free
            total      used      free    shared    buffers    cached
Mem:        496156    244948    251208          0      14068    211048
-/+ buffers/cache:      19832    476324
Swap:            0          0          0
root@headless:~#

and if I start X

Code:

root@headless:~# ps -ef | grep -E "X|fluxbox"
root      816  800  0 17:30 pts/1    00:00:00 xinit /usr/lib/X11/xinit/xinitrc -- /usr/bin/X :0 -auth /root/.serverauth.800
root      817  816  0 17:30 tty7    00:00:00 /usr/bin/X :0 -auth /root/.serverauth.800
root      822  816  0 17:30 pts/1    00:00:00 fluxbox
root      837  594  0 17:31 pts/1    00:00:00 grep -E X|fluxbox
root@headless:~# free
            total      used      free    shared    buffers    cached
Mem:        496156    258380    237776          0      14760    217832
-/+ buffers/cache:      25788    470368
Swap:            0          0          0
root@headless:~#

Memory usage is so low I've not even considered configuring swap.

haziz 02-11-2014 04:51 PM

Quote:

Originally Posted by TobiSGD (Post 5115000)
Have you checked with top or htop which process is using that much memory? Also, what exactly does free report?

I finally did. Interestingly this time is is using only 200 megs (I did see 360 megs last time just after booting into the CLI):

Output from free this time:

Code:

haziz@slack:~$ free
            total      used      free    shared    buffers    cached
Mem:        496828    202092    294736          0      34192    143168
-/+ buffers/cache:      24732    472096
Swap:      999996          0    999996

Output from top:

Code:

Tasks:  62 total,  1 running,  61 sleeping,  0 stopped,  0 zombie
Cpu(s): 11.7%us,  4.5%sy,  0.0%ni, 82.4%id,  1.0%wa,  0.2%hi,  0.1%si,  0.0%st
Mem:    496828k total,  205348k used,  291480k free,    35236k buffers
Swap:  999996k total,        0k used,  999996k free,  144592k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                       
  621 haziz    20  0  2840 1064  836 R  5.7  0.2  0:00.06 top                                                                                                                                                                           
    1 root      20  0  1824  636  568 S  0.0  0.1  0:00.91 init                                                                                                                                                                           
    2 root      20  0    0    0    0 S  0.0  0.0  0:00.00 kthreadd                                                                                                                                                                       
    3 root      20  0    0    0    0 S  0.0  0.0  0:00.12 ksoftirqd/0                                                                                                                                                                   
    5 root      0 -20    0    0    0 S  0.0  0.0  0:00.00 kworker/0:0H                                                                                                                                                                   
    6 root      20  0    0    0    0 S  0.0  0.0  0:00.12 kworker/u2:0                                                                                                                                                                   
    7 root      20  0    0    0    0 S  0.0  0.0  0:00.33 rcu_preempt                                                                                                                                                                   
    8 root      20  0    0    0    0 S  0.0  0.0  0:00.00 rcu_bh                                                                                                                                                                         
    9 root      20  0    0    0    0 S  0.0  0.0  0:00.00 rcu_sched                                                                                                                                                                     
  10 root      0 -20    0    0    0 S  0.0  0.0  0:00.00 khelper                                                                                                                                                                       
  11 root      20  0    0    0    0 S  0.0  0.0  0:00.01 kdevtmpfs                                                                                                                                                                     
  12 root      0 -20    0    0    0 S  0.0  0.0  0:00.00 netns                                                                                                                                                                         
  13 root      20  0    0    0    0 S  0.0  0.0  0:00.20 kworker/0:1                                                                                                                                                                   
  14 root      0 -20    0    0    0 S  0.0  0.0  0:00.00 writeback                                                                                                                                                                     
  15 root      0 -20    0    0    0 S  0.0  0.0  0:00.00 bioset                                                                                                                                                                         
  16 root      0 -20    0    0    0 S  0.0  0.0  0:00.00 kblockd                                                                                                                                                                       
  17 root      20  0    0    0    0 S  0.0  0.0  0:00.29 khubd                                                                                                                                                                         
  18 root      0 -20    0    0    0 S  0.0  0.0  0:00.00 rpciod                                                                                                                                                                         
  19 root      20  0    0    0    0 S  0.0  0.0  0:00.00 khungtaskd                                                                                                                                                                     
  20 root      20  0    0    0    0 S  0.0  0.0  0:00.00 kswapd0


TobiSGD 02-11-2014 05:06 PM

There seems to be confusion about what free reports. The memory actually used by the system for applications can be found in the second row, in your case about 24MB. Have a look here: http://www.linuxatemyram.com/

haziz 02-11-2014 06:49 PM

Quote:

Originally Posted by TobiSGD (Post 5115853)
There seems to be confusion about what free reports. The memory actually used by the system for applications can be found in the second row, in your case about 24MB. Have a look here: http://www.linuxatemyram.com/

Thanks. That makes for interesting reading. Interestingly the man page for free does not make that explicit.

Thanks again.


All times are GMT -5. The time now is 06:21 PM.