Recently, the company has several Java servers often appear can not allocate memory situation. Causes SSH login to fail.
Therefore, it is necessary to do something.
We can use Linux-ftools to see what's Inside Linux cached (Tools to find it yourself, blog upload attachments failed):
#!/bin/bash
Tar XF linux-ftools.tar.gz-c./
CD linux-ftools/&&./configure && make && make install
After the installation is complete, generate 3 files under/usr/local/bin linux-fadvise, Linux-fallocate, Linux-fincore
Common commands:
Linux-fincore--help
Example: Check which file commands are cached in the/tmp directory:
Linux-fincore--pages=false--summarize--only-cached/tmp/*
In this case, if can not allocate memory is often present, we can configure a scheduled task, using Linux-fincore to periodically obtain a directory (such as Java program each time the file cache to/opt/xxx/this directory) and save the cached to the file.
In this case, again the memory is not enough to allocate the time, so that we later traced the scene.
This article is from the "Vegetable Chicken" blog, please be sure to keep this source http://lee90.blog.51cto.com/10414478/1922951
Linux-ftools see what's Inside Linux cached