LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-08-2023, 03:45 AM   #16
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,498

Rep: Reputation: Disabled

Quote:
Originally Posted by dedec0 View Post
Did you mean "that only have 4M ram"? 4B is four bytes, and this make no sense.
:lol: No, the 'G' didn't print, & I didn't notice, it should read 4GB, (now corrected)....

Last edited by fatmac; 04-08-2023 at 03:47 AM.
 
Old 04-08-2023, 07:57 AM   #17
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,314

Rep: Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327
I've only 4G on my RazPi. I use a lightweight WM (XFCE) and it's generally ok. With Zoom under box64, a lot of libs are processed and held in ram, and I need 6G. Does your swap show in df -h? If not, it's not mounted, or might be puny. Here's how I made my swap file
  1. Pick some file or just touch one
  2. dd if=/dev/zero of=swapfile bs=100M count=2048
  3. mkswap swapfile
  4. swapon swapfile
Then enter it in /etc/fstab. htop is also good for memory stats.

Last edited by business_kid; 04-08-2023 at 07:59 AM.
 
Old 04-08-2023, 08:04 AM   #18
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Post

Quote:
Originally Posted by fatmac View Post
:lol: No, the 'G' didn't print, & I didn't notice, it should read 4GB, (now corrected)....
I see. So, it has a fairly good amount of memory. Probably the same as the computer with the problem here.

But you are (possibly) using the "bad unity" of measure, that conflicts with the International System of Units (ISU). See what i said in the #8 post, in this thread.

Since you are using something derived from Debian, i think you will have the same "details" in the free command. It is a bit offtopic for the thread, but i think it has its importance. Do a few commands to see, show us, and i show you my output here, in the good computer:



$ free -h # Use the shorter 3 digits unity closer to each value
total used free shared buff/cache available
Mem.: 15Gi 10Gi 2,1Gi 1,7Gi 3,0Gi 3,3Gi
Swap: 15Gi 717Mi 15Gi

$ free -b # Use bytes (B) unity for all values
total used free shared buff/cache available
Mem.: 16690577408 11274518528 2184806400 1822777344 3231252480 3547979776
Swap: 17082347520 751828992 16330518528

$ free --si # Use I.S.U. units
total used free shared buff/cache available
Mem.: 16299392 10915508 2215820 1792592 3168064 3547052
Swap: 16681980 734208 15947772

$



See the difference? If we use letters k, M, G, T, etc. to count computing related things, there is ambiguity. And companies use this "detail" to sell us less than we think. To buy, we receive a "16 gigabytes" (I. S. U. things) memory. But what it really has is actually "15,544 gigabytes" (1024 power), or correctly writing and saying: 15,544 GiB or 15,544 gibibytes (fifteen gibibytes and five hundred and fourty for thousandths ).

Last edited by dedec0; 04-08-2023 at 09:11 AM.
 
Old 04-09-2023, 04:08 AM   #19
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,498

Rep: Reputation: Disabled
Not sure what this will prove, but here they are, (I normally use free -m, so have included it also).

Code:
keith@msi:~$ free -m
               total        used        free      shared  buff/cache   available
Mem:            3730        1028        1524         265        1178        2194
Swap:            255           0         255
keith@msi:~$ free -h
               total        used        free      shared  buff/cache   available
Mem:           3.6Gi       1.0Gi       1.5Gi       265Mi       1.2Gi       2.1Gi
Swap:          255Mi          0B       255Mi
keith@msi:~$ free -b
               total        used        free      shared  buff/cache   available
Mem:      3912134656  1078628352  1597992960   278691840  1235513344  2300465152
Swap:      268431360           0   268431360
keith@msi:~$ free --si
               total        used        free      shared  buff/cache   available
Mem:         3820444     1068460     1545344      272160     1206640     2231420
Swap:         262140           0      262140
(This is with Firefox having been running for several hours.)

Last edited by fatmac; 04-09-2023 at 04:09 AM.
 
Old 04-09-2023, 04:56 AM   #20
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,314

Rep: Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327
So you're using 1 Gig of ram and have 1.5 Gig free besides caches and that's why there's no swap usage. Linux is very efficient with memory. Until I got box64, I never used swap on my RazPi.

The Pi is really slow - period. Arm have much better 64 bit cores than the A-72, but they must be overpriced, so everyone doing things on the cheap gets the A-53 or A-72. Firefox sucks also. Palemoon or Chromium are better.

Last edited by business_kid; 04-09-2023 at 05:05 AM.
 
Old 04-09-2023, 08:35 AM   #21
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
All I'm reading here is that a computer with less RAM is becoming slower than one with more RAM once the swap starts to be used. Isn't that to be expected? Surely the one with less RAM has more of the current, in use, programs and data in swap so finds it slower to access those?
When I have experimented with filling RAM to see what happens (I have no swap) I find that once RAM is full the machine does not slow down it simply starts killing programs to free RAM for the "most important" so I don't think a lack of memory in and of itself causes slowness just the actual inability to use as much RAM.
 
Old 04-09-2023, 09:33 AM   #22
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,314

Rep: Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327
I use slarm64, not debian. Debian for Pi gets mixed reviews, and you don't get answers. Run 'df-h', 'sensors', and 'free -h' again when it's very slow and post results. Debian just don't care. It's not their distro.

Also run htop. You can see where memory & cpu are being used. If it's overheating, the Pi can slow drastically, and switch cores off, which affects performance.

If you want to try slarm64, there's a forum here under distributions and a RazPi 3&4 thread with links to the binary images. It's my choice of the Slackware Arm ports.

Last edited by business_kid; 04-09-2023 at 09:43 AM.
 
Old 04-09-2023, 01:53 PM   #23
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Post

Quote:
Originally Posted by fatmac View Post
Not sure what this will prove, but here they are, (I normally use free -m, so have included it also).

Code:
keith@msi:~$ free -m
               total        used        free      shared  buff/cache   available
Mem:            3730        1028        1524         265        1178        2194
Swap:            255           0         255
keith@msi:~$ free -h
               total        used        free      shared  buff/cache   available
Mem:           3.6Gi       1.0Gi       1.5Gi       265Mi       1.2Gi       2.1Gi
Swap:          255Mi          0B       255Mi
keith@msi:~$ free -b
               total        used        free      shared  buff/cache   available
Mem:      3912134656  1078628352  1597992960   278691840  1235513344  2300465152
Swap:      268431360           0   268431360
keith@msi:~$ free --si
               total        used        free      shared  buff/cache   available
Mem:         3820444     1068460     1545344      272160     1206640     2231420
Swap:         262140           0      262140
(This is with Firefox having been running for several hours.)
And beyond what business_kid said, 'free' says that 1,2Gi are being used with buffer or cache. So, it says, in the last column of your output, you have 2,1Gi available. Is my interpretation of the free output correct, business_kid? (or anyone who wants to say this)

Now, about the comparison of using ISU or not, the difference (in absolute byte numbers) is bigger for bigger numbers. See this "table" with 3 columns and several lines:



Code:
IS unit                     1 B  = 1 byte
Wrong unit (should be)      1 B =       1 byte
Difference (using ISU)      0 B = 0 bytes

IS unit                     1 KiB = 1* 2^10 bytes = 1.024 bytes     
Wrong unit (should be)      1 kB = 1* 10^3 bytes        
Difference (using ISU)      +24             = 24        = 24

IS unit                     1 MiB = 1* 2^20 bytes = 1.048.576 bytes
Wrong unit (should be)      1 MB = 1* 10^6 bytes =  1.000.000 bytes
Difference (using ISU)      +48.576         = 49 KiB    = 49kB

IS unit                     1 GiB = 1* 2^30 bytes = 1.073.741.824 bytes 
Wrong unit (should be)      1GB =   1* 10^9 bytes = 1.000.000.000 bytes
Difference (using ISU)      +73.741.824     = 73 MiB    = 73MB

IS unit                     1 TiB = 1* 2^40 bytes = 1.099.511.627.776 bytes 
Wrong unit (should be)      1TB =   1* 10^12 =      1.000.000.000.000 bytes
Difference (using ISU)      +99.511.627.776 = 99 GiB    = 99GB


So, when we buy a disk with "1TB" of space, you may be thinking you are getting almost 100 GiB more than what it actually has!

And when you use the argument "-m" for free, you are always getting numbers being showed in MiB. They are in ISU mibibytes. So, the number of bytes of each number you see, should be obtained when you multiply it by 2^20 (which is 1 MiB). Is this clear?
 
Old 04-09-2023, 01:57 PM   #24
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by 273 View Post
All I'm reading here is that a computer with less RAM is becoming slower than one with more RAM once the swap starts to be used. Isn't that to be expected? Surely the one with less RAM has more of the current, in use, programs and data in swap so finds it slower to access those?
When I have experimented with filling RAM to see what happens (I have no swap) I find that once RAM is full the machine does not slow down it simply starts killing programs to free RAM for the "most important" so I don't think a lack of memory in and of itself causes slowness just the actual inability to use as much RAM.
No. Not expected to the point it is happening here. No program was ever killed (the browser keeps running, ever for days, as i have tried a few of the first times this happened; and it would be the first one that would be killed, i think). And its disk is not so slow.
 
Old 04-09-2023, 02:00 PM   #25
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by dedec0 View Post
No. Not expected to the point it is happening here. No program was ever killed (the browser keeps running, ever for days, as i have tried a few of the first times this happened; and it would be the first one that would be killed, i think). And its disk is not so slow.
But using swap is slow - remember that unless you're not using that disk for anything but swap it's also being used by other processes and that the speed of swap is levels of magnitude slower than RAM.
The fact you're not seeing processes being killed means you're not exhausting your swap and RAM, and the system is behaving as it should, it's just the swap you are using is slowing your system.

Last edited by 273; 04-09-2023 at 02:04 PM.
 
Old 04-09-2023, 02:00 PM   #26
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Question

Quote:
Originally Posted by business_kid View Post
I use slarm64, not debian. Debian for Pi gets mixed reviews, and you don't get answers. Run 'df-h', 'sensors', and 'free -h' again when it's very slow and post results. Debian just don't care. It's not their distro.

Also run htop. You can see where memory & cpu are being used. If it's overheating, the Pi can slow drastically, and switch cores off, which affects performance.

If you want to try slarm64, there's a forum here under distributions and a RazPi 3&4 thread with links to the binary images. It's my choice of the Slackware Arm ports.
You are not saying this to my problem, right? But the other situation cited above, for comparison, correct?
 
Old 04-09-2023, 02:20 PM   #27
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by 273 View Post
But using swap is slow - remember that unless you're not using that disk for anything but swap it's also being used by other processes and that the speed of swap is levels of magnitude slower than RAM.
The fact you're not seeing processes being killed means you're not exhausting your swap and RAM, and the system is behaving as it should, it's just the swap you are using is slowing your system.
No. It does not make sense. During the slowness periods, there is no other process making much use of RAM or disk or swap - if any, since they are so little. And the slowness is a lot stronger than I have seen years ago when (for example) using a computer with 32MiB of RAM run a game that recommends 512MiB or more. 4GiB of RAM, today, is something common. The hardware of the computer good i have been calling good is probably worse than the other.

My "disk of bad" here has a lot of free space (around 213GiB). The swap is huge (64GiB, and it is never used, i barely see it in the system monitor graph, seen all the time), so the system should (probably should, this is a guess, a thought of mine) not worry to split data to store into smaller pieces, to fit into fragmented space, or moving data to make free space have bigger continuous areas.
 
Old 04-09-2023, 02:25 PM   #28
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by dedec0 View Post
No. It does not make sense. During the slowness periods, there is no other process making much use of RAM or disk or swap - if any, since they are so little. And the slowness is a lot stronger than I have seen years ago when (for example) using a computer with 32MiB of RAM run a game that recommends 512MiB or more. 4GiB of RAM, today, is something common. The hardware of the computer good i have been calling good is probably worse than the other.

My "disk of bad" here has a lot of free space (around 213GiB). The swap is huge (64GiB, and it is never used, i barely see it in the system monitor graph, seen all the time), so the system should (probably should, this is a guess, a thought of mine) not worry to split data to store into smaller pieces, to fit into fragmented space, or moving data to make free space have bigger continuous areas.
OK, so if swap isn't the problem a way way to confirm this is to turn off swap and make full use of the RAM and see whether it slows then. If it doesn't slow in that case then it is something to do with swap and if it doesn't then it's not.
 
1 members found this post helpful.
Old 04-10-2023, 07:41 AM   #29
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,314

Rep: Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327
I'm seeing posts here which is crazy. @decdec0, the dictionary is the only place you see 'success' come before 'work.'

sure windows slows. Magazines write about windows, but we're fixing a linux problem. Linux is very well designed. I had a chance to obseve my 3.7G being overloaded. It filled up to 3.4-3.5G, and then started filling swap. I'll bet you're not using swap.

It could be: Chips overheating; dodgy disk partitions; a kernel problem; a very slow network; library incompatabilities, to name just a few. You won't try anything, so how do we know? Check those areas out. Don't waffle but give us information in short diagnostic posts.
 
1 members found this post helpful.
Old 04-11-2023, 05:02 PM   #30
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Arrow

Quote:
Originally Posted by business_kid View Post
I'm seeing posts here which is crazy. @decdec0, the dictionary is the only place you see 'success' come before 'work.'

sure windows slows. Magazines write about windows, but we're fixing a linux problem. Linux is very well designed. I had a chance to obseve my 3.7G being overloaded. It filled up to 3.4-3.5G, and then started filling swap. I'll bet you're not using swap.

It could be: Chips overheating; dodgy disk partitions; a kernel problem; a very slow network; library incompatabilities, to name just a few. You won't try anything, so how do we know? Check those areas out. Don't waffle but give us information in short diagnostic posts.
Right. Thank you for this list.

I will try this starting list, for now. I have already checked how to disable swap, I will just prepare a few details to avoid losing anything, in the case of the system killing running programs.

A problem of very slow network should not be the problem, I think. The network for these 2 computers is the same: both connected with a cable to the same modem (and it receives data with a coaxial cable, from the network company). I would see the slowness in the other computer, I think.
 
  


Reply

Tags
debian, memory, ram, swap



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Why is my Debian computer only using 2GB RAM? (i686 2013 Macbook Pro running Debian KDE) theOakBaron Linux - Hardware 4 02-03-2018 04:18 PM
Why swap space did not function when physical memory ( RAM ) is full ? subankar Linux - Server 7 10-11-2012 12:02 PM
Why size of swap space is 2x of RAM??? Why not 1.5x of RAM or 2.5x of RAM??? Saurav Ghosh Linux - Newbie 7 11-01-2011 03:49 AM
Why should you give the size of the swap disk as twice the size of RAM vmniza Linux - Newbie 3 09-17-2004 02:13 AM
why swap should be twice of RAM? whitefox Slackware 17 04-19-2003 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration