# Tmpfs is too big for me. How to decrease its footprint?

**URL:** https://dietpi.com/forum/t/tmpfs-is-too-big-for-me-how-to-decrease-its-footprint/13959
**Category:** General Discussion
**Created:** [12 August 2022 14:05 UTC](https://dietpi.com/forum/t/tmpfs-is-too-big-for-me-how-to-decrease-its-footprint/13959 "2022-08-12T14:05:45Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![DrCWO](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/71c47a/32.png) [@DrCWO](https://dietpi.com/forum/u/DrCWO)
#### Post date: [12 August 2022 14:05 UTC](https://dietpi.com/forum/t/tmpfs-is-too-big-for-me-how-to-decrease-its-footprint/13959/1 "2022-08-12T14:05:45Z")

</div>

Hello community,  
I am quite a happy user of DietPi on a friendlyElec R2S device.

My only concern ist that it has only 1GB of RAM and half of it is reserved for tmpfs.  
I wonder how to decrease tmpfs to a smaller footprint.

Any help would be appreciated 😊

---

<div class="post-metadata">

### Author: ![DrCWO](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/71c47a/32.png) [@DrCWO](https://dietpi.com/forum/u/DrCWO)
#### Post date: [12 August 2022 14:45 UTC](https://dietpi.com/forum/t/tmpfs-is-too-big-for-me-how-to-decrease-its-footprint/13959/2 "2022-08-12T14:45:57Z")

</div>

I made it 👍  
/etc/fstab was my friend 🤭

---

<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: [12 August 2022 15:04 UTC](https://dietpi.com/forum/t/tmpfs-is-too-big-for-me-how-to-decrease-its-footprint/13959/3 "2022-08-12T15:04:30Z")

</div>

Btw, a tmpfs does not reserve the RAM, but uses it only on demand. There are multiple other tmpfs mounts (`df -h`) with a summed size larger than total RAM, which is totally fine as they never actually fully use that size concurrently. I recommend to leave the /tmp size as it was (50% of RAM + swap), especially on low RAM devices. Otherwise `dietpi-software` installs might fail, which often download and extract to, sometimes compile in /tmp tmpfs to reduce disk writes.

---

<div class="post-metadata">

### Author: ![DrCWO](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/71c47a/32.png) [@DrCWO](https://dietpi.com/forum/u/DrCWO)
#### Post date: [12 August 2022 15:45 UTC](https://dietpi.com/forum/t/tmpfs-is-too-big-for-me-how-to-decrease-its-footprint/13959/4 "2022-08-12T15:45:24Z")

</div>

Very interesting :- 👍  
I have disables swp and htop shows me this:  
 ![image](https://dietpi.com/forum/uploads/default/original/2X/b/b915c75578eff352de21f438688ed8eef342131f.png)

I wonder what it means as it did not change when I decrease tmpfs in fstab. This looks quite crouded to me so I tried to decrease tmpfs.

On the other hand cat /proc/meminfo gives me an inactive space of 650MB but only a free space of 79MB while running my software. I fear the 79MB might not be enough in the long run. And what is the difference between free and available 🤨

Would you please explain that to me so I will get a bit smarter?

MemTotal: 999584 kB  
MemFree: 79788 kB  
MemAvailable: 392600 kB  
Buffers: 12244 kB  
Cached: 453576 kB  
SwapCached: 0 kB  
Active: 152764 kB  
Inactive: 650516 kB  
Active(anon): 31060 kB  
Inactive(anon): 408712 kB  
Active(file): 121704 kB  
Inactive(file): 241804 kB  
Unevictable: 0 kB  
Mlocked: 0 kB  
SwapTotal: 0 kB  
SwapFree: 0 kB  
Dirty: 20 kB  
Writeback: 0 kB  
AnonPages: 337564 kB  
Mapped: 167080 kB  
Shmem: 102312 kB  
KReclaimable: 22508 kB  
Slab: 57172 kB  
SReclaimable: 22508 kB  
SUnreclaim: 34664 kB  
KernelStack: 3728 kB  
PageTables: 7456 kB  
NFS\_Unstable: 0 kB  
Bounce: 0 kB  
WritebackTmp: 0 kB  
CommitLimit: 499792 kB  
Committed\_AS: 1337212 kB  
VmallocTotal: 133143592960 kB  
VmallocUsed: 15104 kB  
VmallocChunk: 0 kB  
Percpu: 1344 kB  
AnonHugePages: 0 kB  
ShmemHugePages: 0 kB  
ShmemPmdMapped: 0 kB  
FileHugePages: 0 kB  
FilePmdMapped: 0 kB  
CmaTotal: 131072 kB  
CmaFree: 40392 kB  
HugePages\_Total: 0  
HugePages\_Free: 0  
HugePages\_Rsvd: 0  
HugePages\_Surp: 0  
Hugepagesize: 2048 kB  
Hugetlb: 0 kB

---

<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: [12 August 2022 15:56 UTC](https://dietpi.com/forum/t/tmpfs-is-too-big-for-me-how-to-decrease-its-footprint/13959/5 "2022-08-12T15:56:58Z")

</div>

Linux uses available memory to cache reads and writes from resp. to filesystem, to speed those up and reduce actual disk I/O. These are the blue (buffer) and yellow (cache) parts of the memory usage bar in `htop`. So it’s expected to be nearly full, hence “MemFree” very low. Important is only that “MemAvailable” is sufficiently large resp. the green part of the bar not too large on common usage.

The size of any tmpfs has no effect on RAM usage as long as you do not actually store files into them to use that space.

---

<div class="post-metadata">

### Author: ![DrCWO](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/71c47a/32.png) [@DrCWO](https://dietpi.com/forum/u/DrCWO)
#### Post date: [13 August 2022 06:18 UTC](https://dietpi.com/forum/t/tmpfs-is-too-big-for-me-how-to-decrease-its-footprint/13959/6 "2022-08-13T06:18:11Z")

</div>

> [@MichaIng](#):
>
> The size of any tmpfs has no effect on RAM usage as long as you do not actually store files into them to use that space.

Thank you for you in depth explanation. I got smarter 👍
