I'm trying to analyze an issue with a remote server that is running out of available memory.

I have no idea when it happens, but when it does, I'm unable to SSH into the machine. I can only remotely reboot it and then log in.

So, I had the idea of simply staying logged in until the problem happens. That way I could analyze the situation. But once there is no more available memory, I'm not gonna have a great time debugging the problem.

So, is there a way to reserve memory for processes which are spawned by myself?
Not programmatically if possible.

1 Answer 1


From what your saying, if you reserve the memory it still won't be available for your debugging tool.

Have you considered writing detailing logs to file?

Include as much info on each process as you need and run the command every few minutes. You could do this with cron.

After the next reboot you simply examine the logs.

Here is some info on how to check what process are using your memory.

  • Yes, I thought about that. And I will resort to doing that if my idea remains fruitless. I don't even want to run major debugging tools. But when no RAM is available, even cat can be problematic, I guess. Commented Apr 23, 2012 at 21:08
  • The only tool I can think of that really grabs and holds enough memory to perform many tasks is a Virtual Machine host like VirtuaBox. It's not much use in your scenario.
    – bryan
    Commented Apr 23, 2012 at 21:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .