Got it

[Memory Faults]Identifying Processes with High Memory Usage

108 0 0 0 0

hello, everyone!

this post i will introduce you a Memory faults of "Identifying Processes with High Memory Usage".  

let's discuss it together.


[Symptom]

The memory usage of a node is high or even exceeds the threshold.

[Memory Usage Remains High]

  1. Run the top command on the involved node and press M on the keyboard (to sort the processes by memory usage).

    1_en-us_image_0228249344.png

  2. Run ps -ef | grep <PID of the process with high memory usage>.

    Check detailed information about the process and query its log. Check whether the high memory usage is normal.

  3. Run the following command to query the top 10 processes that occupy the most memory:

    ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head

    1_en-us_image_0228249345.png

[Memory Usage Is High Occasionally]

  1. Query the /var/log/osinfo/statistics/ps.txt file. It records the results of the ps command that is executed every 2 minutes.

    The file records only the basic information of the processes.

  2. Run the following command to query the top 10 processes that occupy the most memory:

    ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head

  3. Create the checkmem.sh file on the involved node. logFile is the log file and delayTime is the execution interval (s).

    #!/usr/bin/env bashlogFile=/var/log/Bigdata/checkMemoryUsage.logdelayTime=30  # seconds between each excute, default value is 30 secondswhile( true )doecho `date` >> $logFileecho "USER        PID %CPU %MEM    VSZ RSS TTY      STAT START TIME COMMAND " >> $logFileps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head >> $logFilesleep $delayTimeecho " " >> $logFiledone
  4. Run the following scripts at the background:

    chmd 700 /opt/checkmem.sh

    nohup /opt/checkmem.sh  > /dev/null  2>/dev/null  &

  5. Query the /var/log/Bigdata/checkMemoryUsage.log file and check for information about high memory usage.

    If a Java process is using great memory, the common cause is that a great memory size is configured.

  6. Stop the check script process.

    On the node, run ps -ef | grep checkmem.sh | grep -v grep. Find the PID and kill the process.


Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.