kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* How to clean up buffer or cache momory?
@ 2012-02-16 12:59 黄小伟
  2012-02-16 13:21 ` Manish Katiyar
  2012-02-16 13:33 ` 黄小伟
  0 siblings, 2 replies; 6+ messages in thread
From: 黄小伟 @ 2012-02-16 12:59 UTC (permalink / raw)
  To: kernelnewbies

 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.
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120216/a9319ed8/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* How to clean up buffer or cache momory?
  2012-02-16 12:59 How to clean up buffer or cache momory? 黄小伟
@ 2012-02-16 13:21 ` Manish Katiyar
  2012-02-16 13:33 ` 黄小伟
  1 sibling, 0 replies; 6+ messages in thread
From: Manish Katiyar @ 2012-02-16 13:21 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* How to clean up buffer or cache momory?
  2012-02-16 12:59 How to clean up buffer or cache momory? 黄小伟
  2012-02-16 13:21 ` Manish Katiyar
@ 2012-02-16 13:33 ` 黄小伟
  2012-02-17  7:13   ` Wang Chao
                     ` (2 more replies)
  1 sibling, 3 replies; 6+ messages in thread
From: 黄小伟 @ 2012-02-16 13:33 UTC (permalink / raw)
  To: kernelnewbies

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 at kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120216/b4d49d18/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* How to clean up buffer or cache momory?
  2012-02-16 13:33 ` 黄小伟
@ 2012-02-17  7:13   ` Wang Chao
  2012-02-21  5:29   ` Pei Lin
  2012-02-21 13:20   ` 黄小伟
  2 siblings, 0 replies; 6+ messages in thread
From: Wang Chao @ 2012-02-17  7:13 UTC (permalink / raw)
  To: 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 at kernelnewbies.org
> >http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


-- 
Thanks,
Chao Wang

^ permalink raw reply	[flat|nested] 6+ messages in thread

* How to clean up buffer or cache momory?
  2012-02-16 13:33 ` 黄小伟
  2012-02-17  7:13   ` Wang Chao
@ 2012-02-21  5:29   ` Pei Lin
  2012-02-21 13:20   ` 黄小伟
  2 siblings, 0 replies; 6+ messages in thread
From: Pei Lin @ 2012-02-21  5:29 UTC (permalink / raw)
  To: 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 at kernelnewbies.org
>>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Best Regards
Lin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* How to clean up buffer or cache momory?
  2012-02-16 13:33 ` 黄小伟
  2012-02-17  7:13   ` Wang Chao
  2012-02-21  5:29   ` Pei Lin
@ 2012-02-21 13:20   ` 黄小伟
  2 siblings, 0 replies; 6+ messages in thread
From: 黄小伟 @ 2012-02-21 13:20 UTC (permalink / raw)
  To: kernelnewbies

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 at kernelnewbies.org
>> >http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
>-- 
>Thanks,
>Chao Wang
>
>_______________________________________________
>Kernelnewbies mailing list
>Kernelnewbies at kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120221/605a7db7/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-02-21 13:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-16 12:59 How to clean up buffer or cache momory? 黄小伟
2012-02-16 13:21 ` Manish Katiyar
2012-02-16 13:33 ` 黄小伟
2012-02-17  7:13   ` Wang Chao
2012-02-21  5:29   ` Pei Lin
2012-02-21 13:20   ` 黄小伟

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).