1

Can someone please help me understand the output that I get from the top command? This is the point that the oom-killer is invoked and kills my main application. What exactly is under the VSZ and %VSZ? What is 502m304.5??enter image description here

Cooli
  • 13
  • 3

2 Answers2

0

From http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html:

vsz = "The size of the process in (virtual) memory in 1024 byte units as a decimal integer."

phk
  • 5,953
  • 7
  • 42
  • 71
0

Your output shows that top is printing some escape sequences that the terminal doesn't recognize. The bits where you see a blank followed by [ followed by more garbage characters are escape sequences that work on most terminals; the first character of those sequences is the escape character, which your terminal prints as a blank. For example, ␛[7m at the beginning of the title line starts inverse video, ␛[0m stops inverse video, etc.

I'm not sure exactly what's going on with the STAT and VSZ column but it seems that top has printed some color-changing sequences there too (that's where the m is coming from), and they've been partially overwritten (top is probably printing a character which does make the cursor go left so that the next character overwrites what was there).

With many programs, setting the TERM environment variable correctly is enough: it should indicate a terminal type that doesn't support any escape sequences. Make sure that you don't have a script that hard-codes a value of TERM somewhere. Try TERM=dumb. If you're using BusyBox, I think its top hard-codes escape sequences that work on most terminals, so you're out of luck. You could run it through a filter that removes escape sequences. Untested, but should work with BusyBox.

#!/bin/sh
script=$(printf 's/\033\\[[0-9;]*[A-Za-z]//g')
sed -e "$script" "$@"

(From this more complete Perl script)