I am facing one problem, On our Linux server Free memory decreases gradually but my java process memory does not increase.
Please any one tell, why free memory decreases gradually (1MB in approx 15 minutes).
1/ it's most probable that s93366 is right: the memory is not "going away", it's being cached. It will be deducted from the "free", will be added to the "used", it will be in "cached" columns.
2/ Open a second console and use the "top" command. See which processes use most memory, see how much your java uses.
Yes On my server cache memory also increases some kbs in each 15 minutes
For eg:- if free memory decreases 600 kb then cache memory increases only 100kb
Please tell what is the reason why cache increases
and any kernel tuning required for this problem.
Cache memory is just some nix-trix: instead of "not using" memory your system doesn't need, it will use the memory to "cache data". When an application requests more memory, the kernel will free the cache if needed though, so don't worry, memory used by the cache is actually "available" for your programs.
Your java thing seems indeed to be using 2Gb of memory.. not much more I can say of that. If the java thing grows, then it's probably your java code. If the java thing always uses the same amount of memory, and something else grows, it's something else :')
Hi
run top -i
to see name process have problem
Also see if an files in your repertory tmpfs disk
df to see if mounted and linked directory
Best regards
Konerak is correct. I ask that question to before. I have 16 GB of RAM in a linux machine and all of a sudden it goes to cache but through researching to forums and website that is just normal. It will allocate available memory to cache so that application can use it.
Have you explore the settings on your JAVA apps regarding setting up memory allocated for JAVA?
Again, while this command works, you only revert the linux philosophy: "idle memory is a waste". Linux puts your unused-memory to use, why would you undo that?
As you said when an application requests for more memory the kernel will release the cached memory but I have seen the case where one Java process needs 2gb memory and around 12gb of heap space got cached and at the same time it is showing around 25mb of free space and application throws java.lang.OutOfMemoryError: Java heap space.
Can you please describe it bit more elaborately?
And also let me know how can be the cached memory release and get used during the execution of process?
the kernel will automatically release the cached memory, if available. If java reports an error, perhaps you didn't start the Virtual Machine with the appropriate parameters?
If I recall correctly from my java-days, try launching the VM with the
to allocate 128Mb of memory from the start, and 2048Mb as maximum.
If you're still having problems with java memory leaks, there are toolkits out there to detect leaks in your application. I've never used any, so I suggest you use plain old google.