Re: Inactive memory keep growing and how to release it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 12, 2013 at 4:37 PM, Zheng Liu <gnehzuil.liu@xxxxxxxxx> wrote:
> Hi Gao,
> I don't think it is a bug.  If I understand correctly, when you try to
> reclaim memory (sync and drop caches), the test script is still running,
> right?  If so, that means that some memory will be re-dirtied again.  So
> the number of inactive pages could not reduce as you expected.

The test script has stopped.

Some log messages came from my UML Linux as follows:

...
/sdb/file_test
             total       used       free     shared    buffers     cached
Mem:           182        179          2          0         10         13
-/+ buffers/cache:        155         27
Swap:            0          0          0
/sdb/file_test
^C
[root@localhost ~]#
[root@localhost ~]# sync;
[root@localhost ~]# echo 3 > /proc/sys/vm/drop_caches
[root@localhost ~]#
[root@localhost ~]# echo 3 > /proc/sys/vm/drop_caches
[root@localhost ~]# sync;
[root@localhost ~]# echo 3 > /proc/sys/vm/drop_caches
[root@localhost ~]# free -m
             total       used       free     shared    buffers     cached
Mem:           182        157         25          0          0          3
-/+ buffers/cache:        153         28
Swap:            0          0          0

[root@localhost ~]# cat /proc/meminfo | grep Inac
Inactive:         124756 kB
Inactive(anon):     1408 kB
Inactive(file):   123348 kB
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.30.8 #20 Mon Mar 11 07:04:06 EDT 2013
x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# mount | grep sdb
/dev/ubdb1 on /sdb type ext3 (rw,data=journal)
[root@localhost ~]# cat ./test_write_disk.sh
#!/bin/bash

while true
do

#       file="/sdb/file_`date +%y%m%d%k%m%s`"
        file="/sdb/file_test"

        echo $file

        dd if=/dev/zero of=${file} bs=512 count=20480 &> /dev/null

#	sync
#	cat /proc/meminfo | grep Inactive\(file\)
	free -m

#        rm -fr ${file}
done

-- 
Regards,

Lenky
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux