Solaris Dominance To Present Long Declaration Listing Of A Running Process

One of the employment amongst ps command, which is a pop tool to honour whatsoever processes along amongst grep ascendence inwards Solaris operating arrangement is that it doesn't exhibit total ascendence draw of piece of work declaration of process. This agency if you lot are doing grep on whatsoever text which look at tail halt of long ascendence line, you lot volition probable non able to capture that procedure past times using ps and grep. This is unsafe because it may atomic number 82 you lot to assume that for sure procedure is non running as well as you lot may restart it again, despite its beingness running as well as exclusively because you lot didn't honour the process. This is quite mutual spell running Java procedure inwards whatsoever UNIX operating arrangement e.g. Solaris, Linux, IBM AIX etc because Java procedure commonly has long listing of arguments e.g. system properties, JVM options,  and name of original class. I bring faced this employment quite few fourth dimension fifty-fifty after using ps -ef  option. Until instantly I bring non constitute whatsoever compelling solution for this employment which volition run on all UNIX systems, except for Solaris, which  I am going to percentage amongst you lot guys. So, my exclusively advice is to lay the keyword inwards caput of long ascendence draw of piece of work declaration as well as endeavour to continue Java ascendence draw of piece of work every bit modest every bit possible. Also prefer using ps -auxww over ps -ef,  former amend display long ascendence draw of piece of work than later on as well as you lot bring higher hazard of capturing the procedure past times using grep amongst tail keywords.



Solaris ascendence to display long arguments of running process

 which is a pop tool to honour whatsoever processes along amongst grep ascendence inwards Solaris operatin Solaris Command to Show Long declaration listing of a Running Process
Putting of import keywords e.g. cite of your Java procedure at the start of declaration listing is Ok only what if you lot actually request total ascendence draw of piece of work declaration of whatsoever procedure inwards UNIX environment? Sure at that topographic point must live on around ascendence which tin sack give you lot consummate ascendence draw of piece of work of a running process, no? Well, I didn't know almost it despite using UNIX as well as Linux from long fourth dimension until of late when I actually needed total ascendence draw of piece of work declaration a Java procedure which is taking most of CPU from that machine. I constitute the procedure id (PID) of that Java procedure using prstat ascendence as well as and thus I tried to meet that procedure using ps ascendence for that procedure only didn't meet total ascendence line. Few Google search reveals a ascendence called pargs which shows total ascendence draw of piece of work of a procedure if you lot know procedure id (PID).  It's non a replacement of ps command only all the same a skilful tool to meet total ascendence draw of piece of work of whatsoever procedure inwards Solaris. Here is an illustration of how you lot tin sack utilisation prstat as well as pargs ascendence inwards Solaris to honour a running procedure as well as exhibit its consummate listing of argument.

Command to honour out procedure which is using high CPU

[test@localhost] > prstat -scpu  PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP  28525 test      860M  615M slumber   59    0  80:35:02 3.5% java/833  19681 test      431M  361M cpu0    xxx    0   2:57:43 3.1% ksh/2 

You tin sack meet hither that our Java procedure 28525 is using 3.5% of CPU as well as it has 833 threads. Now nosotros request to honour out consummate listing of arguments passed to this procedure from ascendence draw of piece of work spell starting it. It doesn't affair if it is started from a script or straight because inwards UNIX, start-up script volition live on a dissimilar procedure than your Java application.

Solaris ascendence to exhibit consummate listing of arguments of a running process

[test@localhost]> pargs 28525 pargs: Couldn't produce upwardly one's hear locale of target process. pargs: Some strings may non live on displayed properly. 28525:  /opt/jdk1.6.0_22/bin/java -server -Dsun.rmi.dgc.cli argv[0]: /opt/jdk1.6.0_22/bin/java -server -Dsun.rmi.dgc.cli argv[1]: -server argv[2]: -Dsun.rmi.dgc.client.gcInterval=3600000 argv[3]: -Dsun.rmi.dgc.server.gcInterval=3600000 argv[4]: -verbose:gc argv[5]: -Xloggc:./logs/GC.log argv[6]: -XX:+PrintGCTimeStamps argv[7]: -verbose:gc argv[8]: -Xloggc:./logs/GC.log argv[9]: -XX:+PrintGCTimeStamps argv[12]: -Xms2048M argv[13]: -Xmx2048M argv[14]: -cp

Bingo, instantly you lot tin sack meet that what declaration has passed to procedure amongst PID 28525. You tin sack meet that root declaration is Java executable itself. You tin sack honour out your JDK location every bit good every bit Java version lay out e.g. hither JDK is located at /opt subdivision as well as Java version is JDK 1.6.0_22. Next you lot tin sack meet the declaration exceed to JVM e.g. -server shows that its running on server mode. You tin sack also meet other garbage collection options, startup as well as max memory provided to server as well as it's classpath. I bring non shown total classpath hither purposefully only when you lot run this ascendence inwards Solaris past times yourself, you lot volition meet all the arguments passed to your Java process.


That's all on How to exhibit long ascendence draw of piece of work of a procedure running on Solaris operating system. This is a rattling useful ascendence to troubleshoot Java procedure amongst long listing of arguments e.g. you lot tin sack banking concern jibe what JVM parameters has been passed to your Java process, value of key configuration parameters as well as you lot tin sack also honour how much maximum retention is allocated to your Java application.  

Further Learning
Linux Command Line Basics
Linux Command Line Interface (CLI) Fundamentals
Learn Linux inwards v Days as well as Level Up Your Career

Komentar

Postingan populer dari blog ini

Fixing Java.Net.Bindexception: Cannot Assign Requested Address: Jvm_Bind Inwards Tomcat, Jetty

5 Deviation Betwixt Constructor In Addition To Static Mill Method Inward Java- Pros In Addition To Cons

Top V Websites For Practicing Information Structures Together With Algorithms For Coding Interviews Free