1

From ps -ef | grep java, I see many process like this that take a lot of memory.

hadoop-+ 65369 65322  0 Jul06 ?        00:01:45 /usr/jdk64/jdk1.8.0_112/bin/java -Xmx8024m -Dhdp.version=2.6.4-091 -Djava.net.preferIPv4Stack=true -Dhdp.version=2.6.4-091 -Dhadoop.log.dir=/var/log/hadoop/hadoop-qa -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=/usr/hdp/2.6.4-091/hadoop -Dhadoop.id.str=hadoop-qa -Dhadoop.root.logger=INFO,console -Djava.library.path=:/usr/hdp/2.6.4-091/hadoop/lib/native/Linux-amd64-64:/usr/hdp/2.6.4-091/hadoop/lib/native -Dhadoop.policy.file=hadoop-policy.xml -Djava.net.preferIPv4Stack=true -Xmx8024m -Xmx8024m -Djava.util.logging.config.file=/usr/hdp/2.6.4-091/hive/conf/parquet-logging.properties -Dlog4j.configuration=beeline-log4j.properties -Dhadoop.security.logger=INFO,NullAppender org.apache.hadoop.util.RunJar /usr/hdp/2.6.4-091/hive/lib/hive-beeline-1.2.1000.2.6.4-091.jar org.apache.hive.beeline.BeeLine -u jdbc:hive2://master01.sys7643.com:10000/;transportMode=binary -e

How to know which script/binary/other is running this processes?

1 Answer 1

0

With Java applications it's always the portion of the ps -ef output that looks like this:

org.apache.hive.beeline.BeeLine

This is a Hive related process, this is the Java class structure being shown here. Given the variability of how Java applications typically invoke themselves, it's difficult to programmatically parse this, so you basically have to just learn to visually parse this from the ps -ef output.

You can try and use something like this to parse the output:

$ ps -ef |   sed 's/-D[^ ]*//g;s/-X[^ ]*//g;s#^.*/bin/java##g;s/[^ ]*.jar//g;s/^[ ]*//g'
org.apache.hadoop.util.RunJar  org.apache.hive.beeline.BeeLine -u jdbc:hive2://master01.sys7643.com:10000/;transportMode=binary -e
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This gets you most of the way there, the last bits to parse out of difficult because they're highly app dependent when dealing with Java.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .