Quote:
...I thinks it's a memory leak in some application...
|
If its a memory leak in some application (& that is not clear from what you post),
then it ought to be reasonably easy to detect.
It would probably be a good idea to monitor memory usage over some fixed period, maybe every 10 seconds, maybe longer depending on how long you think you will have to run. If it is a memory leak, that would normally gradually increase. To do this you'd probably run vmstat and you might want to store vmstat results away in a log file to try to get results close to the crash.
The other thing you would do would be to monitor individual processes to check whether any individual process has increasing memory usage. Probably top -n 1 would capture the info that you want (you may have more processes than top easily captures & I'm not sure how top determines the screen length in non-interactive sessions...) and you would want to capture a number of data dumps over a period to see how memory usage grows.
(You could do this more simply with ksysguard - given that its a server, you won't have kde installed on it, but you could use ksysguard on a desktop to monitor memory use on the server, if you place the 'sensors' remotely, but I haven't actually tried this.)
You'd be hoping (for the memory leak theory) to see some process growing over time until its memory size becomes too large; a difficulty is being sure that a process is growing 'illegitimately' (memory leak) versus one that is just growing because its worload has grown too high.