1.列出最占用内存的20个应用
ps auxw | head -1;ps auxw|sort -rn -k4 | head -20

# 最占用内存的5个应用
ps auxw | head -1;ps auxw|sort -rn -k4 | head -5
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     28774  0.1 29.8 4582336 2279152 ?     Sl    2022 126:25 java -Duser.home=/opt/jenkins_home -Djenkins.model.Jenkins.slaveAgentPort=50000 -Dhudson.lifecycle=hudson.lifecycle.ExitLifecycle -jar /usr/share/jenkins/jenkins.war
nie       7908  4.8 12.1 3383580 930996 ?      Sl    2022 10225:23 /opt/elk/es/jdk/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -Djava.security.manager=allow -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -XX:+ShowCodeDetailsInExceptionMessages -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j2.formatMsgNoLookups=true -Djava.locale.providers=SPI,COMPAT --add-opens=java.base/java.io=ALL-UNNAMED -Xms512m -Xmx512m -XX:+UseG1GC -Djava.io.tmpdir=/tmp/es-9955342476988593360 -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError -XX:HeapDumpPath=data -XX:ErrorFile=logs/hs_err_pid%p.log -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m -XX:MaxDirectMemorySize=268435456 -XX:G1HeapRegionSize=4m -XX:InitiatingHeapOccupancyPercent=30 -XX:G1ReservePercent=15 -Des.path.home=/opt/elk/es -Des.path.conf=/opt/elk/es/config -Des.distribution.flavor=default -Des.distribution.type=tar -Des.bundled_jdk=true -cp /opt/elk/es/lib/* org.elasticsearch.bootstrap.Elasticsearch -d
nie       8384  1.2  7.0 11918072 540620 ?     Sl    2022 2712:17 bin/../node/bin/node bin/../src/cli/dist
polkitd  23052  0.2  5.5 1816288 420940 ?      Ssl   2022 226:53 mysqld
nie      23253  0.0  1.9 932092 151428 ?       Ssl   2022  51:14 /opt/gitea/gitea web

丰木
322 声望19 粉丝

遇见超乎想象的自己!