I started a very resources-consuming process on a remote server via ssh. It is an optimization problem run in MATLAB. It takes full memory and CPU. In fact, I am not even able to ssh to the machine, which doesn't reply at all. How do I kill that process? I don't have root access.
If your user started the process, and you only have access remotely, your options are limited.
I would try remotely killing the processes, This may take some time to get queued!
ssh -l $USER $HOSTNAME 'pkill -9 MATLAB'
If this executes, but does not kill the running process. You could always kill all processes created by your user. this would be a more last resort, obviously avoid if you know the process name.
ssh -l $USER $HOSTNAME 'pkill -9 -u $USER'
If you have any KVM or IPMI access, this would be the time to bust it out.
If the machine doesn't react to any network request, you're hosed. By a simple process of elimination, if you can't get remote access, you need console access.
Be patient. If the machine is swapping heavily, it may take several minutes to respond.
For the future, keep an ssh session open, and have the process ID of the potentially troublesome process ready. All mainstream shells have the
kill command built-in, so that you can kill a process even if the machine is heavily under load or your user has reached its process limit.
Also for the future, you can limit the resources that the Matlab process can allocate by running the
ulimit command in the shell where you start it. In particular,
ulimit -Sv 42 will limit the total amount of virtual memory that any one process can allocate to 42kB (the limit applies to each process subsequently started by that shell).