0

I wrote a script that constantly writes a lot of data on a tmpfs partition. The size of this partition is 40% of RAM. The size of the data in this partition never exceeds the 60% of the whole partition capacity. But even if in theory the setup is allright if I monitor the server during the day with "free -m" I notice that the free RAM constantly drops to the point that the servers starts swapping, the out of memory is reached and the system crashes.

This is my /etc/fstab entry:

tmpfs /home/tmpdata tmpfs defaults,size=40%,gid=1000,uid=1000,mode=0777 0 0

My system is Debian 8.3 on a dedicated server with 64GB. I suspect that the RAM never gets freed when the data changes, for example when a file is being deleted.

This is the free -m double output:

root@xxxx:~# free -m
             total       used       free     shared    buffers     cached
Mem:         64454      41792      22661       3884        280      39268
-/+ buffers/cache:       2243      62210
Swap:         1021          0       1021
root@xxxx:~# free -m
             total       used       free     shared    buffers     cached
Mem:         64454      41827      22626       3879        280      39272
-/+ buffers/cache:       2274      62179
Swap:         1021          0       1021

and /cat/meminfo:

root@xxx:~# cat /proc/meminfo
MemTotal:       66001072 kB
MemFree:        20659152 kB
MemAvailable:   59740116 kB
Buffers:          288776 kB
Cached:         42705492 kB
SwapCached:            0 kB
Active:         11959248 kB
Inactive:       32386536 kB
Active(anon):    4179904 kB
Inactive(anon):  1263864 kB
Active(file):    7779344 kB
Inactive(file): 31122672 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       1046520 kB
SwapFree:        1046520 kB
Dirty:               288 kB
Writeback:             8 kB
AnonPages:       1353516 kB
Mapped:           120216 kB
Shmem:           4091776 kB
Slab:             483428 kB
SReclaimable:     300772 kB
SUnreclaim:       182656 kB
KernelStack:        7696 kB
PageTables:        40440 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    34047056 kB
Committed_AS:    7712460 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      389912 kB
VmallocChunk:   34359130252 kB
HardwareCorrupted:     0 kB
DirectMap4k:        6924 kB
DirectMap2M:     2056192 kB
DirectMap1G:    67108864 kB

and cat /proc/swaps:

root@xxxx:~# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/sdb4                               partition       523260  0       -1
/dev/sda4                               partition       523260  0       -2

0 Answers0