If you're using Bash, you can run disown -h job
disown
disown [-ar] [-h] [jobspec ...]
Without options, each jobspec is removed from the table of active jobs.
If the -h
option is given, the job
is not removed from the table, but is
marked so that SIGHUP is not sent to
the job if the shell receives a
SIGHUP. If jobspec is not present, and
neither the -a
nor -r
option is
supplied, the current job is used. If
no jobspec is supplied, the -a
option means to remove or mark all
jobs; the -r
option without a
jobspec argument restricts operation
to running jobs.
(1) I see that each of the running processes occupies a very small percentage of memory (%MEM no more than 0.2%, and most just 0.0%), but how the total memory is almost used as in the fourth line of output ("Mem: 130766620k total, 130161072k used, 605548k free, 919300k buffers")? The sum of used percentage of memory over all processes seems unlikely to achieve almost 100%, doesn't it?
To see how much memory you are currently using, run free -m
. It will provide output like:
total used free shared buffers cached
Mem: 2012 1923 88 0 91 515
-/+ buffers/cache: 1316 695
Swap: 3153 256 2896
The top row 'used' (1923) value will almost always nearly match the top row mem value (2012). Since Linux likes to use any spare memory to cache disk blocks (515).
The key used figure to look at is the buffers/cache row used value (1316). This is how much space your applications are currently using. For best performance, this number should be less than your total (2012) memory. To prevent out of memory errors, it needs to be less than the total memory (2012) and swap space (3153).
If you wish to quickly see how much memory is free look at the buffers/cache row free value (695). This is the total memory (2012)- the actual used (1316). (2012 - 1316 = 696, not 695, this will just be a rounding issue)
(2) how to understand the load average on the first line ("load average: 14.04, 14.02, 14.00")?
This article on load average uses a nice traffic analogy and is the best one I've found so far: Understanding Linux CPU Load - when should you be worried?. In your case, as people pointed out:
On multi-processor system, the load is relative to the number of processor cores available. The "100% utilization" mark is 1.00 on a single-core system, 2.00, on a dual-core, 4.00 on a quad-core, etc.
So, with a load average of 14.00 and 24 cores, your server is far from being overloaded.
Best Answer
In most cases just running
ps
is usually sufficient, along with your favorite flags to enable wide output. I lean towardsps -feww
, but the other suggestions here will work. Note that if a program was started out of someone's$PATH
, you're only going to see the executable name, not the full path. For example, try this:It's important to note that the information visible in
ps
can be completely overwritten by the running program. For example, this code:If I compile this into a file called "myprogram" and run it:
And then run
ps
, I'll see a different process name:You can also look directly at
/proc/<pid>/exe
, which may be a symlink to the appropriate executable. In the above example, this gives you much more useful information thanps
: