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]
Run the top command on the involved node and press M on the keyboard (to sort the processes by memory usage).

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.
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

[Memory Usage Is High Occasionally]
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.
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
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 " " >> $logFiledoneRun the following scripts at the background:
chmd 700 /opt/checkmem.sh
nohup /opt/checkmem.sh > /dev/null 2>/dev/null &
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.
Stop the check script process.
On the node, run ps -ef | grep checkmem.sh | grep -v grep. Find the PID and kill the process.

