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:

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:

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?

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.

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

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.

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:

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).