# Increase swap?

**URL:** <https://dietpi.com/forum/t/increase-swap/5828>\
**Category:** General Discussion\
**Created:** [16 October 2021 09:25 UTC](https://dietpi.com/forum/t/increase-swap/5828 "2021-10-16T09:25:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [16 October 2021 09:25 UTC](https://dietpi.com/forum/t/increase-swap/5828/1 "2021-10-16T09:25:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [16 October 2021 12:48 UTC](https://dietpi.com/forum/t/increase-swap/5828/2 "2021-10-16T12:48:39Z")

</div>

Could you share following pls

```nohighlight
free -m

```

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [16 October 2021 14:57 UTC](https://dietpi.com/forum/t/increase-swap/5828/3 "2021-10-16T14:57:31Z")

</div>

```nohighlight
              total used free shared buff/cache available
Mem: 1727 478 18 3 1230 1222
Swap: 320 55 265

```

---

<div class="post-metadata">

**Author:** ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)\
**Post date:** [16 October 2021 18:42 UTC](https://dietpi.com/forum/t/increase-swap/5828/4 "2021-10-16T18:42:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [16 October 2021 21:58 UTC](https://dietpi.com/forum/t/increase-swap/5828/5 "2021-10-16T21:58:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [16 October 2021 22:20 UTC](https://dietpi.com/forum/t/increase-swap/5828/6 "2021-10-16T22:20:53Z")

</div>

how do I increase swap? I dont mind if my sdcard dies after a few months or so as its just a 8gb

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [16 October 2021 22:22 UTC](https://dietpi.com/forum/t/increase-swap/5828/7 "2021-10-16T22:22:41Z")

</div>

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

```nohighlight
df -h

```

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [16 October 2021 23:04 UTC](https://dietpi.com/forum/t/increase-swap/5828/8 "2021-10-16T23:04:15Z")

</div>

looks like ive used 887mb out of 7gb so i have somewhere just above 6gb free

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [16 October 2021 23:07 UTC](https://dietpi.com/forum/t/increase-swap/5828/9 "2021-10-16T23:07:02Z")

</div>

lets go with 1GB SWAP

```nohighlight
/boot/dietpi/func/dietpi-set_swapfile 1024

```

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [17 October 2021 11:43 UTC](https://dietpi.com/forum/t/increase-swap/5828/10 "2021-10-17T11:43:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [17 October 2021 11:55 UTC](https://dietpi.com/forum/t/increase-swap/5828/11 "2021-10-17T11:55:51Z")

</div>

simply execute the command I posted above and magic happen 😉

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [17 October 2021 19:26 UTC](https://dietpi.com/forum/t/increase-swap/5828/12 "2021-10-17T19:26:30Z")

</div>

looks like it’s increased to 1gb. Thank you

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [8 November 2021 13:50 UTC](https://dietpi.com/forum/t/increase-swap/5828/13 "2021-11-08T13:50:57Z")

</div>

heyo comin back to this topic of mine. probably no real issue. I was wondering if the large amount of files i have sitting on my hdd is making dietpi use up a lot of ram as buff/cache?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [8 November 2021 13:56 UTC](https://dietpi.com/forum/t/increase-swap/5828/14 "2021-11-08T13:56:43Z")

</div>

It depends on how often files are used/accessed and which application is using them. Just because they are stored on a HDD, doesn’t mean they are moved into memory.

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [8 November 2021 14:47 UTC](https://dietpi.com/forum/t/increase-swap/5828/15 "2021-11-08T14:47:55Z")

</div>

hmm im using it for smb and pihole. also my samba share responds very quickly. how would i be able to tell if it is putting the hdd to sleep when not in use?

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [8 November 2021 19:23 UTC](https://dietpi.com/forum/t/increase-swap/5828/16 "2021-11-08T19:23:34Z")

</div>

how do i tell how much memory is being taken by the gpu?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [8 November 2021 20:14 UTC](https://dietpi.com/forum/t/increase-swap/5828/17 "2021-11-08T20:14:15Z")

</div>

honestly I don’t have a C2 as all my devices are RPi. On RPi it’s configured inside config.txt

```nohighlight
cat /boot/config.txt | grep gpu_mem

```

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [8 November 2021 20:43 UTC](https://dietpi.com/forum/t/increase-swap/5828/18 "2021-11-08T20:43:50Z")

</div>

Says no such file or directory. Hmm looks like odroid has a dynamic gpu memory system. Doesn’t use manual allocation apparently…it uses whatever memory is not used.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [10 November 2021 13:54 UTC](https://dietpi.com/forum/t/increase-swap/5828/19 "2021-11-10T13:54:54Z")

</div>

The Odroid C2 has a fixed amount of system memory reserved for the GPU. Check:

```nohighlight
free -m

```

The difference of total memory to ~2000 MiB is what the GPU/VPU uses. You can disable it via dietpi-config \> Display Options \> GPU/RAM Memory Split, which will disable all video output but restores ~300 MiB RAM for the system.

It can be also changed manually via nographics setting in /boot/boot.ini.

---

<div class="post-metadata">

**Author:** ![kannz](https://dietpi.com/forum/user_avatar/dietpi.com/kannz/32/4666_2.png) [@kannz](https://dietpi.com/forum/u/kannz)\
**Post date:** [12 November 2021 04:24 UTC](https://dietpi.com/forum/t/increase-swap/5828/20 "2021-11-12T04:24:16Z")

</div>

thank you the small amount of extra memory may help use swap a little less. 🙂

[Next page](https://dietpi.com/forum/t/increase-swap/5828.md?page=2)
