Clearing memory cache on Linux server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Clearing memory cache on Linux server
# 1  
Old 05-17-2013
Clearing memory cache on Linux server

i wish to clear memory cache on a production box and i was wondering what is the worst that can happen if i do?

i already tested this on a backup server and everything seemed fine.

but i need to know from you experts what are the worst things that can happen when i run it on a real server:

Code:
sync && echo 1 > /proc/sys/vm/drop_caches

the reason i need to run this is because i've been getting error messages similar to:

Code:
could not be performed due to a fork() error: 'Resource temporarily unavailable'.

before running the above command, i will of course make sure all applications aon the host are shut down. then i'll run the command.

any advice?
# 2  
Old 05-18-2013
There is something else causing the error. Not memory. The OS will relinquish memory used for file caches in deference to any request for memory. Automatically, and sometimes kinda slowly depending on the number of dirty pages.

You problem is elsewhere:
For example, free process slots, a process trying to exceed a soft or hard process limit.

So, where is the message appearing exactly, i.e., syslog, and what is the exact message?
The exact OS will help, too.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 05-18-2013
Please don't blame Linux - it is a holy cow!
In my experience it does not have a negative impact.
But you'll need to reset drop_caches to 0 if you ever want to flush it again. It only flushes at a change from 0 to 1
This User Gave Thanks to MadeInGermany For This Post:
# 4  
Old 05-18-2013
Quote:
Originally Posted by jim mcnamara
There is something else causing the error. Not memory. The OS will relinquish memory used for file caches in deference to any request for memory. Automatically, and sometimes kinda slowly depending on the number of dirty pages.

You problem is elsewhere:
For example, free process slots, a process trying to exceed a soft or hard process limit.

So, where is the message appearing exactly, i.e., syslog, and what is the exact message?
The exact OS will help, too.
Linux Red Hat 6

i read something online about the process limit. evidently there's a "limit" file i need to edit. but i'm leery about that too. like, what would happen if i did that?

i mean, if a process is trying to exceed a soft or hard process limit, how do i fix it so the process can do so?

btw, i'm getting the error message in syslog.
# 5  
Old 05-18-2013
You have to identify the process with the problem. Then work backwards from there.
Check the user profile set up, ulimit, those sorts of things. Check the code/script/logs for ideas about what that process does. We had a daemon do this because it failed to reap children and process-level active process limit was 256. We saw zombies, so we had a clue. So it was a code problem. fork() fails generally when:

1. there are no free process slots on the system
2. the process tries to exceed some predefined limit on process creation. could be local to the process itself.
3. There is not enough virtual memory - not likely since you have active in-memory caching.



And Red Hat is not one I know well. They made things "different" from other systems, so any advice as to what to tweak would need to come from a Red Hat expert.

Here is a closed to me resource page:
https://access.redhat.com/site/solutions/22105
This User Gave Thanks to jim mcnamara For This Post:
# 6  
Old 05-19-2013
Are you running nagios ?
If yes, what version ?
This message might be related to a memory leak with the embedded perl module in nagios. See for example Nagios Tracker - 0000339: Memory leak in nagios 3.4.1 with embedded perl - Mantis
The solution would be then to restart nagios or better, to either downgrade or upgrade nagios to a version that doesn't suffer the issue (if any).
This User Gave Thanks to jlliagre For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

clear cache memory

hi all, i have noticed that my server has 64 GB RAM and i have application in this server but the server has free memory only 15% and utilized 85% however it didn't eat from swap . does any parameter can be configured in kernel to make the system clear memory from cache like linux i found... (4 Replies)
Discussion started by: maxim42
4 Replies

2. Red Hat

Need to release Cache memory

Right now i am using Red Hat Enterprise Linux AS release 4 and cache memory occupying around 1.5GB mentioned below, total used free shared buffers cached Mem: 2026 2021 5 0 161 1477 -/+ buffers/cache: 382 1644 ... (4 Replies)
Discussion started by: thakshina
4 Replies

3. Linux

File cache /Page cache Linux

Hi All, could any one point out any open source test-suites for "File cache" testing and as well as performance test suites for the same. Currently my system is up with Linux/ext4. Regards Manish (0 Replies)
Discussion started by: hmanish
0 Replies

4. UNIX for Advanced & Expert Users

linux memory buffers & cache usage

18:45:47 # free -m total used free shared buffers cached Mem: 96679 95909 770 0 1530 19550 -/+ buffers/cache: 74828 21851 Swap: 12287 652 11635 Hi all. The below output is from a RHEL 4.5... (0 Replies)
Discussion started by: drummerrob
0 Replies

5. UNIX for Dummies Questions & Answers

High use of cache memory

Hi, I'm running a debian lenny 1GB ram, but with a high I/O. This server has 400IOPS and 3MB/s sustain. So, I noted cached memory use 800MB, buffered memory use 50MB, and no free memory is available. Questions: What does mean such a high cached memory? Who's using this cached memory? Is... (3 Replies)
Discussion started by: iga3725
3 Replies

6. Shell Programming and Scripting

Clearing a defined function from memory

I guess what I mean is: is there something like unalias to clear functions defined by sourcing a script or config/alias file from memory? Is it necessary to start a new terminal session, or can it be done with a command? I tried "function somefunc {}" but bash told me it hit an "unexpected... (0 Replies)
Discussion started by: SilversleevesX
0 Replies

7. Linux

Memory Usage on Linux server

Hi , As I am new to Linux server, I am facing some doubts like: On linux server virtual memory usage goes to 99%, but I have Threshold limit of 95%. So it crossed the threshold limit and alarmd. Yesterday I moniterd the server using TOP command, and found some of Tibco process was consuming... (4 Replies)
Discussion started by: Jaywantmm
4 Replies

8. UNIX for Dummies Questions & Answers

Memory Usage on Linux server

Hi , As I am new to Linux server, I am facing some doubts like: On linux server virtual memory usage goes to 99%, but I have Threshold limit of 95%. So it crossed the threshold limit and alarmd. Yesterday I moniterd the server using TOP command, and found some of Tibco process was consuming... (1 Reply)
Discussion started by: Jaywantmm
1 Replies

9. UNIX for Advanced & Expert Users

Clearing Shared Memory

Hi, I have various applications on my unix server and one of them relies on a process that needs to start in order to print however the process is not starting at all. I think the problem lies in the shared memory. Does anyone have the commands to flush the shared memory and can anyone tell me if... (2 Replies)
Discussion started by: cipfaadmin
2 Replies

10. Windows & DOS: Issues & Discussions

Clearing of cache memory

Pls! will someone help me on how to clear my cache memory of my Internet browser Thanks Kayode (3 Replies)
Discussion started by: kayode
3 Replies
Login or Register to Ask a Question