LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-08-2011, 06:48 AM   #1
johnmccarthy
Member
 
Registered: Jul 2010
Posts: 64

Rep: Reputation: 1
Smile Clear Memory of Residual Applications no longer Running


Our RHEL 5 systems run an application that absorbs much of the memory and processors power. When the application ends the our RHEL 5 systems still run slow. The command top does not reflect the application is running any longer so we are forced to reboot to clear the buffer. Is there anyway to clear or flush the memory without rebooting the computer? A million thanks,

Johnny Mac
 
Old 11-08-2011, 07:11 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Yes, there is -- simply
Code:
sync;sync;sync
You do it three times to make sure that everything is flushed; the first will take a while, the second significantly less time and the third instantly.

If this is an application you've written, be sure to close all open files in the application and exit cleanly; e.g., in C
Code:
fclose (file1);
fclols (file2);
exit (0);
Using sync from the command line is also not a bad idea if you're writing to a flash drive; they're not anywhere near as fast as disk drives and, sometimes, the write buffers are not flushed as quickly as you'd think so just entering sync on a command line will "make sure."

Hope this helps some.
 
Old 11-08-2011, 07:14 AM   #3
Juako
Member
 
Registered: Mar 2010
Posts: 202

Rep: Reputation: 84
AFAICT as long as the process is really finished, its memory will be eventually reclaimed by applications or the buffer cache.
 
Old 11-08-2011, 08:18 AM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by johnmccarthy View Post
When the application ends the our RHEL 5 systems still run slow.
I doubt any real slow down lasts a significant time after the application ends.

I'm pretty sure you are misunderstanding memory statistics (seeing memory filled by buffers and cache) and expecting that to cause a slow down, and imagining the slow down you expect.

It is perfectly normal for buffers and cache to be filled up by some large applications. While there are ways to free that memory, freeing that memory will not improve system performance.

If you had interactive processes paused during the run of the big application, those will be slow to regain their memory after the big application ends. But they will be no faster (maybe even a little slower) at regaining their memory if you clear the cache at the end of running the big application.

Some commonly used applications might typically launch fast because their code is usually in cache. Running the big application might push those out of cache, so they launch slowly the next time they are run. Again, flushing cache after running the big application will not help (and might hurt).

Last edited by johnsfine; 11-08-2011 at 08:23 AM.
 
  


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
[SOLVED] Cache memory clear snjksh Linux - Server 5 03-10-2014 07:52 AM
How to check memory usage on running process/applications rickylim Linux - General 17 05-08-2013 09:09 PM
Clear most used applications in KDE iain.ross Linux - Software 1 06-07-2006 02:13 PM
Clear Free Memory lowlifeish Linux - General 3 12-12-2005 12:12 PM
Clear most used applications in KDE iain.ross Linux - Software 3 01-18-2005 07:50 AM

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

All times are GMT -5. The time now is 02:00 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