How to clean up buffer or cache momory?
Hi I encounter a problem recentely. My system supports USB strorage and other network applications. But after I put a file to usb storage, it will consume some many momory. (buffer + cache). And these buffered memory can not be reclaimed(use free command). So I want to know how to reclaim the buffer memory in a short time.
2012/2/16 黄小伟 <jingle2422@163.com>:
Hi I encounter a problem recentely. My system supports USB strorage and other network applications. But after I put a file to usb storage, it will consume some many momory. (buffer + cache). And these buffered memory can not be reclaimed(use free command). So I want to know how to reclaim the buffer memory in a short time.
Google for ./sys/vm/drop_caches -- Thanks - Manish
I know this, but I want to reclaim dynamically. Say in a shout time, several seconds. 在 2012-02-16 21:21:11,"Manish Katiyar" <mkatiyar@gmail.com> 写道:
2012/2/16 黄小伟 <jingle2422@163.com>:
Hi I encounter a problem recentely. My system supports USB strorage and other network applications. But after I put a file to usb storage, it will consume some many momory. (buffer + cache). And these buffered memory can not be reclaimed(use free command). So I want to know how to reclaim the buffer memory in a short time.
Google for ./sys/vm/drop_caches
-- Thanks - Manish
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On 02/16/12 at 09:33pm, 黄小伟 wrote:
I know this, but I want to reclaim dynamically. Say in a shout time, several seconds. Why do want to do that? Does it have a bad influence on performance? Kernel will reclaim these cache itself when your machine runs out of mm.
在 2012-02-16 21:21:11,"Manish Katiyar" <mkatiyar@gmail.com> 写道:
2012/2/16 黄小伟 <jingle2422@163.com>:
Hi I encounter a problem recentely. My system supports USB strorage and other network applications. But after I put a file to usb storage, it will consume some many momory. (buffer + cache). And these buffered memory can not be reclaimed(use free command). So I want to know how to reclaim the buffer memory in a short time.
Google for ./sys/vm/drop_caches
-- Thanks - Manish
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Thanks, Chao Wang
I know, but it can not allocate all the cache memory, so you will fail sometimes if the memory has not been reclaimed. 在 2012-02-17 15:13:18,"Wang Chao" <wangchao19890207@gmail.com> 写道:
On 02/16/12 at 09:33pm, 黄小伟 wrote:
I know this, but I want to reclaim dynamically. Say in a shout time, several seconds. Why do want to do that? Does it have a bad influence on performance? Kernel will reclaim these cache itself when your machine runs out of mm.
在 2012-02-16 21:21:11,"Manish Katiyar" <mkatiyar@gmail.com> 写道:
2012/2/16 黄小伟 <jingle2422@163.com>:
Hi I encounter a problem recentely. My system supports USB strorage and other network applications. But after I put a file to usb storage, it will consume some many momory. (buffer + cache). And these buffered memory can not be reclaimed(use free command). So I want to know how to reclaim the buffer memory in a short time.
Google for ./sys/vm/drop_caches
-- Thanks - Manish
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Thanks, Chao Wang
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
在 2012年2月16日 下午9:33,黄小伟 <jingle2422@163.com> 写道:
I know this, but I want to reclaim dynamically. Say in a shout time, several seconds.
http://www.kernel.org/doc/Documentation/sysctl/vm.txt drop_caches Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free. To free pagecache: echo 1 > /proc/sys/vm/drop_caches To free dentries and inodes: echo 2 > /proc/sys/vm/drop_caches To free pagecache, dentries and inodes: echo 3 > /proc/sys/vm/drop_caches As this is a non-destructive operation and dirty objects are not freeable, the user should run `sync' first. So the left thing, you could write down scripts or codes to do the action above while detecting the operation of the device.
在 2012-02-16 21:21:11,"Manish Katiyar" <mkatiyar@gmail.com> 写道:
2012/2/16 黄小伟 <jingle2422@163.com>:
Hi I encounter a problem recentely. My system supports USB strorage and other network applications. But after I put a file to usb storage, it will consume some many momory. (buffer + cache). And these buffered memory can not be reclaimed(use free command). So I want to know how to reclaim the buffer memory in a short time.
Google for ./sys/vm/drop_caches
-- Thanks - Manish
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Best Regards Lin
participants (4)
-
Manish Katiyar -
Pei Lin -
Wang Chao -
黄小伟