That is fairly widespread whereas working Java processes in any UNIX working system e.g. Solaris, Linux, IBM AIX, and so forth as a result of Java course of often has an extended checklist of arguments like system properties, JVM choices, and identify of the primary class.
I’ve confronted this drawback fairly a number of instances even after utilizing ps -ef choice. Till now I’ve not discovered any compelling answer for this drawback which can work on all UNIX methods, aside from Solaris, which I’m going to share with you guys.
So, my solely recommendation is to place the key phrase within the head of the lengthy command-line argument and attempt to hold the Java command line as small as potential.
Solaris command to show lengthy arguments of working course of
Placing essential key phrases e.g. identify of your Java course of at first of argument checklist is Okay however what if you really want full command line argument of any course of in UNIX atmosphere? Positive there have to be some command which may give you full command line of a working course of, no?
Command to search out out course of which is utilizing excessive CPU
Right here is an instance of how you need to use prstat and pargs command in Solaris to discover a working course of and present its full checklist of argument.
[test@localhost] > prstat -scpu PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 28525 take a look at 860M 615M sleep 59 0 80:35:02 3.5% java/833 19681 take a look at 431M 361M cpu0 30 0 2:57:43 3.1% ksh/2
You possibly can see right here that our Java course of 28525 is utilizing 3.5% of CPU and it has 833 threads. Now we have to discover out full checklist of arguments handed to this course of from command line whereas beginning it. It would not matter whether it is began from a script or straight as a result of in UNIX, start-up script will probably be a unique course of than your Java utility.
Solaris command to point out an entire checklist of arguments of a working course of
Right here is the whole instance of pargs command in Solaris which takes course of id and shows the total checklist of argument which is used to run that course of. It is a useful gizmo to see full command with JVM choices used to begin a Java course of in Solaris
[test@localhost]> pargs 28525 pargs: Could not decide locale of goal course of. pargs: Some strings will not be displayed correctly. 28525: /decide/jdk1.6.0_22/bin/java -server -Dsun.rmi.dgc.cli argv[0]: /decide/jdk1.6.0_22/bin/java -server -Dsun.rmi.dgc.cli argv[1]: -server argv[2]: -Dsun.rmi.dgc.shopper.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, now you may see that what argument has handed to course of with PID 28525. You possibly can see that first argument is Java executable itself. You could find out your JDK location in addition to Java model quantity e.g. right here JDK is situated at /decide partition and Java model is JDK 1.6.0_22.
That is all on Learn how to present lengthy command line of a course of working on Solaris working system. It is a very helpful command to troubleshoot Java course of with lengthy checklist of arguments e.g. you may test what JVM parameters has been handed to your Java course of, worth of key configuration parameters and it’s also possible to discover how a lot most reminiscence is allotted to your Java utility.
- 10 examples of date command in Linux (examples)
- Learn how to get an IP tackle from the hostname (command)
- 10 examples of the xargs command in Linux (examples)
- 5 Free Programs to study Linux for Learners (Free programs)
- 10 examples of tar command in UNIX (examples)
- 10 examples of reduce command in Linux (examples)
- 10 examples of Vim in UNIX (examples)
- 10 examples of lsof command in Linux (examples)
- Learn how to create, replace and delete mushy hyperlink in UNIX (command)
- 5 examples of kill command in Linux (examples)
- 6 Free Programs to study Bash scripting in-depth (free programs)
- 10 examples of chmod command in UNIX (examples)
- 10 examples of curl command in Linux (examples)
- 10 Books each Linux Energy consumer ought to learn (books)
- 5 examples of kind command in Linux (examples)
- 10 Finest Linux Programs for Programmers and Builders (Programs)
Thanks for studying this text thus far. Should you like this Linux and Solaris command tutorial and examples, then please share it with your mates and colleagues.
In case you have any questions or suggestions, then please drop a notice.