XFS has memory leak

Bug #25098 reported by Scott Testerman
8
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Medium
Adam Conrad

Bug Description

Brief description:

When performing file operations (e.g. cp, mv, tar) involving an XFS-formatted
partition on a different disk, memory usage increases radically and does not
decrease when the operation is complete.

Steps to reproduce:

Note: You may wish to logout and stop GDM before continuing, as your session
may become unusable after this test (hence the bug report).

1) Create an XFS partition on a secondary disk.
2) Mount the XFS partition and copy some large files (300Mb or larger) to it.
3) Note that real memory usage has increased dramatically, generally also
requiring swap memory usage to increase.
4) Unmount the XFS partition and note that memory usage reduces, but not to the
expected level.
5) Remove the running XFS module and note that memory usage remains at a
slightly increased level.

Additional information:

Rebooting the machine will bring memory usage back, and memory usage will remain
correct even if the XFS partition is mounted, so long as no file operations are
performed that involve the XFS partition. My primary partitions are ReiserFS,
and do not exhibit the problem.

Problem occurs on:

Ubuntu 5.10
Kernel 2.6.9-12-k7 (Ubuntu-provided)

Revision history for this message
Scott Testerman (scott-testerman) wrote :

On additional testing, this problem appears to be an interaction between
nvidia-glx and XFS. I am unable to reproduce the problem without nvidia-glx
enabled, and am likewise unable to reproduce on a filesystem other than XFS.
The version of nvidia-glx in question is 1.0.7667-0ubuntu25.

Revision history for this message
Ben Collins (ben-collins) wrote :

Since I can't push a bug upstream involving nvidia proprietary driver, punting
this over to linux-restricted-modules

Revision history for this message
John Dong (jdong) wrote :

I cannot confirm this on a Dapper or Breezy system. After copying a 300MB file on 2GB of RAM, RAM usage does increase, but that's due to increased cache and buffers. If sysctl's vm.swappiness is set too high, yes, that can cause unused programs to be swapped in favor of optimizing disk performance. There are circumstances where this actually boosts overall system performance (i.e. most servers).

Note that XFS caches read/write data a lot more aggressively than any other filesystem Linux has to offer, so expect more memory usage.

If you are a desktop user and want XFS's cache to back off if any program needs memory, edit /etc/sysctl.conf, add "vm.swappiness=5". This number ranges from 0 to 100, 0 favoring memory usage by applications and 100 favoring memory usage by cache. 60 is default. When set to 5, the cache will immediately back off whenever a program wants RAM, so swapping should stop. I've never dared to set it to 100, so whoever's bored can try that one.

To apply, either reboot or type in "sudo sysctl vm.swappiness=5"

Revision history for this message
Martin Bergner (martin-bergner) wrote :

Hi, is this still an issue on Dapper or Edgy?

Revision history for this message
Scott Testerman (scott-testerman) wrote :

I have since converted all XFS partitions, but the last time I tried the problem appears to have been corrected.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

since it doesn't happen anymore, marking as rejected ("fix released" imho would need a concrete patch etc that has been applied :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.