LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-23-2010, 09:32 PM   #1
a_1
LQ Newbie
 
Registered: Nov 2009
Posts: 21

Rep: Reputation: 0
Memory cached & bash problem


Hello.

i have problem when i run this command to ssh to get free ram ,

Code:
echo 3 > /proc/sys/vm/drop_caches
this is code must give me free ram and empty ram cached, i already run this command many time on other nodes i have but with one node when i run this command, i found the ssh hang and can not do any thing , so when i open anther ssh window and type command " top " i see "bash" is take from 89 to 100 % of CPU

i'm try to use kill command like this to stop this bash but can not stop

kill -9 56565
or
killall -9 56565
OR
killall -9 bash

there is nothing need to stop this bash on top using high CPU,


so please if any one can help me ?

Thank you
 
Old 11-23-2010, 09:38 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
It is not needed to "free" RAM this way. If an application needs RAM, the cache will be automatically dropped and the RAM will be assigned to that application. In fact, freeing RAM this way can even decrease performance.
 
Old 11-23-2010, 09:47 PM   #3
a_1
LQ Newbie
 
Registered: Nov 2009
Posts: 21

Original Poster
Rep: Reputation: 0
my nodes used for hosting vpSs and when i need to see the Free -m i see it's like 100 MB only and my node have 16 GB ram , the cached memory is 8 GB . and also the problem now is how to stop/kill this bash on top using all this CPU !!!
 
Old 11-23-2010, 09:48 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by a_1 View Post
my nodes used for hosting vpSs and when i need to see the Free -m i see it's like 100 MB only and my node have 16 GB ram , the cached memory is 8 GB .
And that needs to be changed why exactly? :}



Cheers,
Tink
 
Old 11-23-2010, 09:53 PM   #5
a_1
LQ Newbie
 
Registered: Nov 2009
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
And that needs to be changed why exactly? :}



Cheers,
Tink
i'm sorry but i dont know what you mean !
 
Old 11-23-2010, 10:24 PM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by a_1 View Post
i'm sorry but i dont know what you mean !
Why do you think "my nodes used for hosting vpSs and when i need to see the Free -m i see it's like 100 MB only and my node have 16 GB ram , the cached memory is 8 GB" is a problem?
 
Old 11-23-2010, 10:37 PM   #7
a_1
LQ Newbie
 
Registered: Nov 2009
Posts: 21

Original Poster
Rep: Reputation: 0
Yes problem happend inside vpSs . and it's not problem now to know this info . i'm looking to get help for my orginal post if any one can help me to fix the issue please reply
 
Old 11-23-2010, 10:49 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by a_1 View Post
Yes problem happend inside vpSs . and it's not problem now to know this info . i'm looking to get help for my orginal post if any one can help me to fix the issue please reply
Why do you think it is a problem? Do you know about file system caching as explained on Steve Miller's blog?

EDIT: what Steve Miller doesn't make clear is that unchanged (= not dirty) file system cache pages do not need to be flushed -- the memory they use is available immediately when required for other purposes.

Last edited by catkin; 11-23-2010 at 10:53 PM.
 
Old 11-24-2010, 02:07 AM   #9
a_1
LQ Newbie
 
Registered: Nov 2009
Posts: 21

Original Poster
Rep: Reputation: 0
i'm not talking now about what cach doing i'm talking about how to fix this issue i have
 
Old 11-24-2010, 04:57 AM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
You wouldn't have an issue if you wouldn't drop the cache, which is an completely unneeded action.
 
Old 11-24-2010, 10:26 AM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by a_1 View Post
i'm not talking now about what cach doing i'm talking about how to fix this issue i have
That's the whole point. You don't actually have an issue; yet
your attempt to fix a non-issue brought you here.
 
Old 11-24-2010, 12:58 PM   #12
a_1
LQ Newbie
 
Registered: Nov 2009
Posts: 21

Original Poster
Rep: Reputation: 0
See the attach file , this day number 3 and i still see this bash take 99% to 100 % kill id not working with this top bash
Attached Thumbnails
Click image for larger version

Name:	bash.JPG
Views:	14
Size:	10.8 KB
ID:	5305  
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux memory management: Real memory or Cached buffers? gubbu Linux - Server 2 10-01-2010 01:58 AM
Memory Cached issues razzera Debian 2 03-28-2010 07:43 PM
Memory staying in cached status kaplan71 Red Hat 1 10-25-2006 08:58 AM
Memory Dump for cached passwords SpinningCone Linux - Security 5 07-12-2006 09:27 AM
Increasing the amount of cached memory balteo Linux - General 1 09-16-2005 04:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration