Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a bunch of servers with the below configuration:

Dual Core single processor 2GHz with 1 MB Cache. Swap is enabled with 1GB limit Memory - 2GB OS - RHEL5.3 64bit

One of our alarms is configured to wake us up when Free memory goes below 256MB for 2 hours (continuously) and above. We are constantly running into memory issues in our machines. With just one java service running at a limit of 1 GB (using Xmx flag), the rest of the memory is for the OS to play with. We observe that a lot of memory is being allocated to buffers/cache (as much as 1GB). At this juncture I have a few questions which are being difficult for me to answer correctly.

  1. As much as I have searched, it seems quite not possible to control how much the OS can allocate for buffers/cache. Is there any policy in the OS that will dictate it to control this?
  2. What would be an alarming limit if the java process is CPU bound?
  3. What would be an alarming limit if the java process is IO bound?
  4. If we simply run a single java service (with Xmx much lesser than available RAM), should we even worry about free memory? Won’t SwapUsedPercent be the best parameter to check if we are hitting memory issues?

Kindly share your thoughts.

share|improve this question
add comment

1 Answer

As much as I have searched, it seems quite not possible to control how much the OS can allocate for buffers/cache.

Unless you have done lots and lots of testing I suggest you not even try. The kernel developers have done lots of work trying to get things to be as efficient as possible in the general case. Until you know this is a problem it is better to leave it allow and let it cache as much as it can, it is almost always a good thing.

What would be an alarming limit if the java process is CPU bound?

Depends on your application, but I would be concerned if you where using more then 60% of you CPU.

What would be an alarming limit if the java process is IO bound?

Depends on your application, but usually want to watch the %iowait value.

should we even worry about free memory?

On Linux looking only at 'free memory' is almost never useful. I would be more worried if the buffers and cache were close to 0. I would worry if you started using serious amounts of swap, or if you where swapping frequently.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.