Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

[SOLVED] aufs memory leak

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
nc-pv
n00b
n00b
Posts: 45
Joined: Mon Oct 01, 2012 10:55 pm

[SOLVED] aufs memory leak

  • Quote

Post by nc-pv » Wed Apr 23, 2014 4:34 pm

I have a Gentoo Linux running on diskless station.
I am using SquashFS image as root filesystem.
Following folders are mounted with AUFS to make them writable: /etc, /home/user, /var/lib, /var/log

I noticed mysterious free space disappearance on /var/lib mount point. Investigation has lead to discovering of the following fact:

Performing

Code: Select all

touch /var/lib/test-file
decreases free space on 4096 bytes. Space is not being freed after

Code: Select all

rm /var/lib/test-file
But doing touch again (with same filename) does not decrease free space.

Same thing would occur on

Code: Select all

echo "" > /var/lib/test-file
wich narrows issue down to:


It takes 4096 bytes to create new file on aufs mount point and this space will not be freed after file deletion. It is also true that space would be subtracted only once per file. Consequent file creations (using same path and name) will not decrease the space.


Could anyone with knowledge on the matter give me advice on what to do to fix it? Should I file a bug report?

Here are some command outputs for reference:

Code: Select all

computer ~ # uname -a
Linux computer 3.13.5-aufs #2 SMP Wed Mar 19 09:52:37 EDT 2014 x86_64 Intel(R) Atom(TM) CPU D2550 @ 1.86GHz GenuineIntel GNU/Linux

Code: Select all

computer ~ # zcat /proc/config.gz | grep "AUFS"
CONFIG_AUFS_FS=y
CONFIG_AUFS_BRANCH_MAX_127=y
# CONFIG_AUFS_BRANCH_MAX_511 is not set
# CONFIG_AUFS_BRANCH_MAX_1023 is not set
# CONFIG_AUFS_BRANCH_MAX_32767 is not set
CONFIG_AUFS_SBILIST=y
# CONFIG_AUFS_HNOTIFY is not set
CONFIG_AUFS_RDU=y
# CONFIG_AUFS_SP_IATTR is not set
# CONFIG_AUFS_SHWH is not set
CONFIG_AUFS_BR_RAMFS=y
# CONFIG_AUFS_BR_FUSE is not set
CONFIG_AUFS_BDEV_LOOP=y
# CONFIG_AUFS_DEBUG is not set

Code: Select all

computer ~ # df
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/loop0        298240 298240         0 100% /
etc-tmpfs         298240 298240         0 100% /aufs/etc
var-tmpfs         298240 298240         0 100% /aufs/var/log
varlib-tmpfs      298240 298240         0 100% /aufs/var/lib
varspool-tmpfs    298240 298240         0 100% /aufs/var/spool
home-tmpfs        298240 298240         0 100% /aufs/home/user
etc-aufs           32768    128     32640   1% /etc
var-aufs           32768    408     32360   2% /var/log
varlib-aufs        16384    864     15520   6% /var/lib
varspool-aufs      16384   1792     14592  11% /var/spool
home-aufs        2560000 120868   2439132   5% /home/user
tmpfs             404800    568    404232   1% /run
udev               10240      0     10240   0% /dev
shm              2023988      0   2023988   0% /dev/shm
cgroup_root        10240      0     10240   0% /sys/fs/cgroup
tmpfs              10240      4     10236   1% /var/lib/misc
tmpfs            1048576      4   1048572   1% /tmp

Code: Select all

computer ~ # mount
/dev/loop0 on / type squashfs (ro,relatime)
etc-aufs on /etc type aufs (rw,relatime,si=ad25961ecb76ef6b)
var-aufs on /var/log type aufs (rw,relatime,si=ad25961ecb76bf6b)
varlib-aufs on /var/lib type aufs (rw,relatime,si=ad25961ecb769f6b)
varspool-aufs on /var/spool type aufs (rw,relatime,si=ad25961f5defff6b)
home-aufs on /home/user type aufs (rw,relatime,si=ad25961f5defcf6b)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,size=404800k,mode=755)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=505344,mode=755)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
openrc on /sys/fs/cgroup/openrc type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc)
cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
tmpfs on /var/lib/misc type tmpfs (rw,relatime,size=10240k)
tmpfs on /tmp type tmpfs (rw,relatime,size=1048576k)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
Last edited by nc-pv on Thu Apr 24, 2014 2:04 pm, edited 1 time in total.
Use GNU/Linux
Top
nc-pv
n00b
n00b
Posts: 45
Joined: Mon Oct 01, 2012 10:55 pm

  • Quote

Post by nc-pv » Thu Apr 24, 2014 2:03 pm

OK. Apparently this is AUFS issue having nothing to do with Gentoo itself. The situation happens only when AUFS is used in combination with TMPFS.

Here are relevant links to find out more about problem and possible solution:

AUFS mail list discussion:

http://sourceforge.net/p/aufs/mailman/a ... 0%40jrobl/

ServerFault question with answer (from same person as above link):

http://serverfault.com/a/446402/145512

In summary:

To free up the space immediately remount partition as follows (assume your mount point is /tmp/mnt ):

Code: Select all

# mount -o remount,itrunc_xino=0 /tmp/mnt
To prevent this from happening add following option to mount command (author had mention he does not know will this affect performance of the system):

Code: Select all

# mount -t aufs -n -o "br:/tmp/rw:/usr,trunc_xino" none "/tmp/mnt"
Use GNU/Linux
Top
Post Reply

2 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic