Increase swap? Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
kannz
Posts: 51
Joined: Wed Sep 29, 2021 2:37 pm

Increase swap?

Post by kannz »

Heyo my C2 isn't having any problems so far but it does say it's using all the swap allocated. Should I increase the swap? It doesn't seem to be using all of the ram..at the moment it's using 212mb of 1.69gb of ram.
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Increase swap?

Post by Joulinar »

Could you share following pls

Code: Select all

free -m
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
kannz
Posts: 51
Joined: Wed Sep 29, 2021 2:37 pm

Re: Increase swap?

Post by kannz »

Code: Select all

              total        used        free      shared  buff/cache   available
Mem:           1727         478          18           3        1230        1222
Swap:           320          55         265
User avatar
trendy
Posts: 389
Joined: Tue Feb 25, 2020 2:54 pm

Re: Increase swap?

Post by trendy »

You are using less than half of the available memory. Swap should not even be used at that point, although a small part of it is. Take in consideration that swap is much slower than ram, so if it really starts running on swap it will become sluggish.
Personally I turn off swap in my small boards to avoid any read/writes on the sd card.
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Increase swap?

Post by Joulinar »

well there are 18MB memory free only as quite a lot is used on file system cache. Therefore SWAP is going to be used. You could increase SWAP to ensure having enough memory available.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
kannz
Posts: 51
Joined: Wed Sep 29, 2021 2:37 pm

Re: Increase swap?

Post by kannz »

how do I increase swap? I dont mind if my sdcard dies after a few months or so as its just a 8gb
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Increase swap?

Post by Joulinar »

how much space you have free on your SD card? Just to not grab all your disk space 8)

Code: Select all

df -h
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
kannz
Posts: 51
Joined: Wed Sep 29, 2021 2:37 pm

Re: Increase swap?

Post by kannz »

looks like ive used 887mb out of 7gb so i have somewhere just above 6gb free
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Increase swap?

Post by Joulinar »

lets go with 1GB SWAP

Code: Select all

/boot/dietpi/func/dietpi-set_swapfile 1024
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
kannz
Posts: 51
Joined: Wed Sep 29, 2021 2:37 pm

Re: Increase swap?

Post by kannz »

do I need to disable swap before changing the size? how do i do that?
Post Reply