[Ocfs2-users] OCFS2 has a likely memory leak. Bug 864

John Lange john.lange at open-it.ca
Mon Mar 26 21:06:59 PDT 2007


This is also filed as bug 864:
http://oss.oracle.com/bugzilla/show_bug.cgi?id=864

After much testing it appears that the version of ocfs2 include with
SLES 10 (2.6.16.27-0.9-default) has a memory leak.

To prove this I used this simple script to write to an ocfs2 mounted
file system mounted at "/data".

------
#!/bin/bash

dd if=/dev/urandom of=/tmp/file bs=1024 count=75

COUNT2=`cat /tmp/COUNT2`
COUNT1=0

DIR1=$(printf "%03d" $COUNT2)
mkdir /data/$DIR1

while [ "$COUNT1" -lt 101 ]
  do
    cp -v /tmp/file /data/$DIR1/file.$COUNT1
  (( COUNT1++ ))
done
(( COUNT2++ ))
echo $COUNT2 > /tmp/COUNT2

------

I then executed it as follows:

while [ true ] ; \
 do /root/bin/populateocfs2.sh ; echo 3 > /proc/sys/vm/drop_caches ;
sleep 2 ; \
 vmstat |tail -n 1 >> /root/tmp/sysstats.txt ; done

------

Leave it running for long enough to generate a significant amount of
data and then graph the "free" column from sysstats.txt.

Memory erodes continuously over time (by about 56bytes at each
iteration) and is never recovered. Left long enough the machine crashes
with oom-killer.

For comparison I then ran the exact same script again on an ext3 file
system and there was no memory loss.

I have now tested this on 5 different machines in several different
configurations and the only thing in common on the machines when the
memory loss occurs is ocfs2.

Here is slabinfo take from the conclusion of the ocfs2 test.

slabinfo - version: 2.1
# name            <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <limit> <batchcount> <sharedfactor> : slabdata <active_slabs> <num_slabs> <sharedavail>
ocfs2_lock            16    203     16  203    1 : tunables  120   60    0 : slabdata      1      1      0
ocfs2_inode_cache    690    744    832    4    1 : tunables   54   27    0 : slabdata    186    186      0
ocfs2_uptodate       423    452     32  113    1 : tunables  120   60    0 : slabdata      4      4      0
ocfs2_em_ent         740    944     64   59    1 : tunables  120   60    0 : slabdata     16     16      0
dlmfs_inode_cache      1      7    544    7    1 : tunables   54   27    0 : slabdata      1      1      0
dlm_mle_cache          1     13    288   13    1 : tunables   54   27    0 : slabdata      1      1      0
configfs_dir_cache     15     78     48   78    1 : tunables  120   60    0 : slabdata      1      1      0
ip_conntrack_expect      0      0     92   42    1 : tunables  120   60    0 : slabdata      0      0      0
ip_conntrack          17     17    232   17    1 : tunables  120   60    0 : slabdata      1      1      0
fib6_nodes             5    113     32  113    1 : tunables  120   60    0 : slabdata      1      1      0
ip6_dst_cache          4     17    224   17    1 : tunables  120   60    0 : slabdata      1      1      0
ndisc_cache            1     24    160   24    1 : tunables  120   60    0 : slabdata      1      1      0
RAWv6                  4      6    608    6    1 : tunables   54   27    0 : slabdata      1      1      0
UDPv6                  0      0    576    7    1 : tunables   54   27    0 : slabdata      0      0      0
tw_sock_TCPv6          0      0    128   30    1 : tunables  120   60    0 : slabdata      0      0      0
request_sock_TCPv6      0      0    128   30    1 : tunables  120   60    0 : slabdata      0      0      0
TCPv6                  5      6   1184    6    2 : tunables   24   12    0 : slabdata      1      1      0
ip_fib_alias          11    113     32  113    1 : tunables  120   60    0 : slabdata      1      1      0
ip_fib_hash           11    113     32  113    1 : tunables  120   60    0 : slabdata      1      1      0
dm_events             16    169     20  169    1 : tunables  120   60    0 : slabdata      1      1      0
dm_tio                 0      0     16  203    1 : tunables  120   60    0 : slabdata      0      0      0
dm_io                  0      0     20  169    1 : tunables  120   60    0 : slabdata      0      0      0
ext3_inode_cache     760   1728    468    8    1 : tunables   54   27    0 : slabdata    216    216      0
ext3_xattr             0      0     48   78    1 : tunables  120   60    0 : slabdata      0      0      0
journal_handle         6    169     20  169    1 : tunables  120   60    0 : slabdata      1      1      0
journal_head         396    648     52   72    1 : tunables  120   60    0 : slabdata      7      9      0
revoke_table           6    254     12  254    1 : tunables  120   60    0 : slabdata      1      1      0
revoke_record         16    203     16  203    1 : tunables  120   60    0 : slabdata      1      1      0
UNIX                 399    410    384   10    1 : tunables   54   27    0 : slabdata     41     41      0
ip_mrt_cache           0      0     96   40    1 : tunables  120   60    0 : slabdata      0      0      0
tcp_bind_bucket        8    203     16  203    1 : tunables  120   60    0 : slabdata      1      1      0
inet_peer_cache        0      0     64   59    1 : tunables  120   60    0 : slabdata      0      0      0
secpath_cache          0      0    128   30    1 : tunables  120   60    0 : slabdata      0      0      0
xfrm_dst_cache         0      0    288   13    1 : tunables   54   27    0 : slabdata      0      0      0
ip_dst_cache          15     15    256   15    1 : tunables  120   60    0 : slabdata      1      1      0
arp_cache              2     30    128   30    1 : tunables  120   60    0 : slabdata      1      1      0
RAW                    2      8    480    8    1 : tunables   54   27    0 : slabdata      1      1      0
UDP                    9     16    480    8    1 : tunables   54   27    0 : slabdata      2      2      0
tw_sock_TCP            0      0     96   40    1 : tunables  120   60    0 : slabdata      0      0      0
request_sock_TCP       0      0     64   59    1 : tunables  120   60    0 : slabdata      0      0      0
TCP                    8     14   1056    7    2 : tunables   24   12    0 : slabdata      2      2      0
flow_cache             0      0     96   40    1 : tunables  120   60    0 : slabdata      0      0      0
cfq_ioc_pool         120    120     96   40    1 : tunables  120   60    0 : slabdata      3      3      0
cfq_pool              80     80     96   40    1 : tunables  120   60    0 : slabdata      2      2      0
crq_pool              96    234     48   78    1 : tunables  120   60    0 : slabdata      3      3      0
deadline_drq           0      0     52   72    1 : tunables  120   60    0 : slabdata      0      0      0
as_arq                 0      0     64   59    1 : tunables  120   60    0 : slabdata      0      0      0
mqueue_inode_cache      1      7    512    7    1 : tunables   54   27    0 : slabdata      1      1      0
isofs_inode_cache      0      0    348   11    1 : tunables   54   27    0 : slabdata      0      0      0
minix_inode_cache      0      0    384   10    1 : tunables   54   27    0 : slabdata      0      0      0
hugetlbfs_inode_cache      1     12    320   12    1 : tunables   54   27    0 : slabdata      1      1      0
ext2_inode_cache       0      0    448    9    1 : tunables   54   27    0 : slabdata      0      0      0
ext2_xattr             0      0     48   78    1 : tunables  120   60    0 : slabdata      0      0      0
dnotify_cache          1    169     20  169    1 : tunables  120   60    0 : slabdata      1      1      0
dquot                  0      0    128   30    1 : tunables  120   60    0 : slabdata      0      0      0
eventpoll_pwq          1    101     36  101    1 : tunables  120   60    0 : slabdata      1      1      0
eventpoll_epi          1     40     96   40    1 : tunables  120   60    0 : slabdata      1      1      0
inotify_event_cache      0      0     28  127    1 : tunables  120   60    0 : slabdata      0      0      0
inotify_watch_cache     45    101     36  101    1 : tunables  120   60    0 : slabdata      1      1      0
kioctx                 0      0    160   24    1 : tunables  120   60    0 : slabdata      0      0      0
kiocb                  0      0    128   30    1 : tunables  120   60    0 : slabdata      0      0      0
fasync_cache           1    203     16  203    1 : tunables  120   60    0 : slabdata      1      1      0
shmem_inode_cache    484    486    420    9    1 : tunables   54   27    0 : slabdata     54     54      0
posix_timers_cache      0      0     96   40    1 : tunables  120   60    0 : slabdata      0      0      0
uid_cache              5     59     64   59    1 : tunables  120   60    0 : slabdata      1      1      0
blkdev_ioc           103    127     28  127    1 : tunables  120   60    0 : slabdata      1      1      0
blkdev_queue          28     28    940    4    1 : tunables   54   27    0 : slabdata      7      7      0
blkdev_requests      116    176    176   22    1 : tunables  120   60    0 : slabdata      8      8      0
biovec-(256)         260    260   3072    2    2 : tunables   24   12    0 : slabdata    130    130      0
biovec-128           264    265   1536    5    2 : tunables   24   12    0 : slabdata     53     53      0
biovec-64            276    280    768    5    1 : tunables   54   27    0 : slabdata     56     56      0
biovec-16            280    280    192   20    1 : tunables  120   60    0 : slabdata     14     14      0
biovec-4             288    295     64   59    1 : tunables  120   60    0 : slabdata      5      5      0
biovec-1             341   1218     16  203    1 : tunables  120   60    0 : slabdata      6      6      0
bio                  360    640     96   40    1 : tunables  120   60    0 : slabdata     14     16      0
sock_inode_cache     439    450    384   10    1 : tunables   54   27    0 : slabdata     45     45      0
skbuff_fclone_cache     11     11    352   11    1 : tunables   54   27    0 : slabdata      1      1      0
skbuff_head_cache    120    220    192   20    1 : tunables  120   60    0 : slabdata     11     11      0
file_lock_cache        4     44     88   44    1 : tunables  120   60    0 : slabdata      1      1      0
acpi_operand         894    920     40   92    1 : tunables  120   60    0 : slabdata     10     10      0
acpi_parse_ext         0      0     44   84    1 : tunables  120   60    0 : slabdata      0      0      0
acpi_parse             0      0     28  127    1 : tunables  120   60    0 : slabdata      0      0      0
acpi_state             0      0     48   78    1 : tunables  120   60    0 : slabdata      0      0      0
delayacct_cache        0      0     40   92    1 : tunables  120   60    0 : slabdata      0      0      0
proc_inode_cache      39    132    336   11    1 : tunables   54   27    0 : slabdata     12     12      0
sigqueue              27     27    144   27    1 : tunables  120   60    0 : slabdata      1      1      0
radix_tree_node     1901   3346    276   14    1 : tunables   54   27    0 : slabdata    239    239      0
bdev_cache            26     27    448    9    1 : tunables   54   27    0 : slabdata      3      3      0
sysfs_dir_cache     4463   4508     40   92    1 : tunables  120   60    0 : slabdata     49     49      0
mnt_cache             26     30    128   30    1 : tunables  120   60    0 : slabdata      1      1      0
inode_cache          999   1332    320   12    1 : tunables   54   27    0 : slabdata    111    111      0
dentry_cache        2738   8370    128   30    1 : tunables  120   60    0 : slabdata    279    279      0
filp                2808   2808    160   24    1 : tunables  120   60    0 : slabdata    117    117      0
names_cache           10     10   4096    1    1 : tunables   24   12    0 : slabdata     10     10      0
idr_layer_cache      187    203    136   29    1 : tunables  120   60    0 : slabdata      7      7      0
buffer_head        14304  17280     52   72    1 : tunables  120   60    0 : slabdata    240    240      0
mm_struct             90     90    416    9    1 : tunables   54   27    0 : slabdata     10     10      0
vm_area_struct      5032   5148     88   44    1 : tunables  120   60    0 : slabdata    117    117      0
fs_cache              89    113     32  113    1 : tunables  120   60    0 : slabdata      1      1      0
files_cache           90     90    448    9    1 : tunables   54   27    0 : slabdata     10     10      0
signal_cache         121    121    352   11    1 : tunables   54   27    0 : slabdata     11     11      0
sighand_cache        114    114   1312    3    1 : tunables   24   12    0 : slabdata     38     38      0
task_struct          141    141   1344    3    1 : tunables   24   12    0 : slabdata     47     47      0
anon_vma            2430   2712      8  339    1 : tunables  120   60    0 : slabdata      8      8      0
pgd                   83     83   4096    1    1 : tunables   24   12    0 : slabdata     83     83      0
size-131072(DMA)       0      0 131072    1   32 : tunables    8    4    0 : slabdata      0      0      0
size-131072            0      0 131072    1   32 : tunables    8    4    0 : slabdata      0      0      0
size-65536(DMA)        0      0  65536    1   16 : tunables    8    4    0 : slabdata      0      0      0
size-65536             1      1  65536    1   16 : tunables    8    4    0 : slabdata      1      1      0
size-32768(DMA)        0      0  32768    1    8 : tunables    8    4    0 : slabdata      0      0      0
size-32768            16     16  32768    1    8 : tunables    8    4    0 : slabdata     16     16      0
size-16384(DMA)        0      0  16384    1    4 : tunables    8    4    0 : slabdata      0      0      0
size-16384             2      2  16384    1    4 : tunables    8    4    0 : slabdata      2      2      0
size-8192(DMA)         0      0   8192    1    2 : tunables    8    4    0 : slabdata      0      0      0
size-8192            142    142   8192    1    2 : tunables    8    4    0 : slabdata    142    142      0
size-4096(DMA)         0      0   4096    1    1 : tunables   24   12    0 : slabdata      0      0      0
size-4096            114    114   4096    1    1 : tunables   24   12    0 : slabdata    114    114      0
size-2048(DMA)         0      0   2048    2    1 : tunables   24   12    0 : slabdata      0      0      0
size-2048            132    132   2048    2    1 : tunables   24   12    0 : slabdata     66     66      0
size-1024(DMA)         0      0   1024    4    1 : tunables   54   27    0 : slabdata      0      0      0
size-1024            236    236   1024    4    1 : tunables   54   27    0 : slabdata     59     59      0
size-512(DMA)          0      0    512    8    1 : tunables   54   27    0 : slabdata      0      0      0
size-512             384    432    512    8    1 : tunables   54   27    0 : slabdata     54     54      0
size-256(DMA)          0      0    256   15    1 : tunables  120   60    0 : slabdata      0      0      0
size-256          127320 127320    256   15    1 : tunables  120   60    0 : slabdata   8488   8488      0
size-128(DMA)          0      0    128   30    1 : tunables  120   60    0 : slabdata      0      0      0
size-128            2640   2910    128   30    1 : tunables  120   60    0 : slabdata     97     97      0
size-64(DMA)           0      0     64   59    1 : tunables  120   60    0 : slabdata      0      0      0
size-32(DMA)           0      0     32  113    1 : tunables  120   60    0 : slabdata      0      0      0
size-64              872   1652     64   59    1 : tunables  120   60    0 : slabdata     28     28      0
size-32           130123 130176     32  113    1 : tunables  120   60    0 : slabdata   1152   1152      0
kmem_cache           160    160     96   40    1 : tunables  120   60    0 : slabdata      4      4      0






More information about the Ocfs2-users mailing list