How To Honor Cpu As Well As Retentivity Used Past Times Coffee Procedure Inwards Solaris – Prstat Ascendence Example

We oftentimes involve to uncovering CPU as well as retention utilization of a particular Java procedure inwards gild to acquire around performance stats, capacity planning or merely to empathize the electrical flow charge on the system. Performance monitoring as well as testing is an integral purpose of whatever Java application development, especially if y'all are working inwards high-frequency trading space. In gild to attain a performance problem, y'all accept to uncovering them get-go as well as noesis of correct tools as well as commands helps there. One of the principal displace of miserable application performance is it Java or whatever other procedure is exhaustion of of import resources similar CPU as well as memory. Monitoring CPU as well as retention utilization of your Java procedure give y'all around useful insight similar what is the normal retention as well as CPU utilization, when are y'all getting spikes inwards CPU as well as retention consumption. If  heap memory is constantly increasing over fourth dimension than it’s an indication that your Java application may accept a retention leak. 

In this Java performance tutorial, nosotros volition larn almost 2 most mutual Solaris commands prstat as well as pmap to uncovering CPU as well as retention utilization of Java process. prstat is a procedure monitoring tool easily available inwards whatever Solaris systems including SPARC as well as x86 boxes, which provides useful statics of CPU as well as retention utilization of a process. 

For other systems e.g. windows y'all tin work windows describe director for CPU monitoring as well as Linux y'all tin work top ascendancy for same purpose. By the way, y'all tin also depository fiscal establishment check out Java performance yesteryear Charlie Hunt as well as Binu John, it is immensely helpful for Java performance monitoring as well as tuning. This is the book, which gives y'all correct form of tools as well as noesis required to uncovering performance stats for Java application.



Solaris ascendancy to uncovering CPU as well as Memory utilization of Java process

We oftentimes involve to uncovering CPU as well as retention utilization of a particular Java procedure inwards gild to  How to uncovering CPU as well as Memory used yesteryear Java procedure inwards Solaris – prstat ascendancy exampleprstat ascendancy inwards UNIX, peculiarly inwards Solaris tin move used to uncovering retention as well as CPU consumption of a Java application. prstat needs, procedure id to demo statics of particular process, which tin move obtained yesteryear using ps ascendancy inwards UNIX, equally shown below.

1. Find the PID of Java process

ps -ef | grep "MyJavaSever"

2) Find CPU as well as Memory usage of Java process

prstat -p 28983 5
PID    USERNAME  SIZE   RSS    STATE   PRI     NICE      TIME          CPU     PROCESS/NLWP
29389  appsvs    1129M  445M   sleep   47      4         0:03:44       0.0%    java/49

Now most of import affair is to empathize output of prstat command, 2 columns which are most of import are RSS and CPU. If y'all await human being page for Solaris prstat command, RSS denotes full amount of physical retention used yesteryear the process as well as CPU denotes the full percent of CPU used yesteryear that Java process. RSS stands for Resident Set Size as well as shows full physical retention used yesteryear the procedure on Kilobytes(K), Megabytes(M) as well as Gigs(G). On the other hand, nosotros accept around other retention stats denoted yesteryear SIZE which shows the full size of virtual retention used yesteryear Java procedure or whatever other procedure including mapped files as well as devices. SIZE denotes the size of virtual retention inwards Kilobytes(K), Megabytes(M) or Gigabytes(G).

TIME denotes full fourth dimension duration for which that particular Java procedure is running.

USERNAME shows the Solaris user account on which procedure is started as well as running.

PRI denotes priority of your Java process. Higher the number way Higher the priority of Java procedure y'all are monitoring.

You tin run into that prstat is rattling useful ascendancy as well as also easily available on almost every Solaris machine, It respond cardinal questions similar How much CPU as well as retention is currently utilized as well as which procedure are using those. It also provides useful details related to process/threads. You tin also run prstat command amongst an interval equally inwards higher upward instance CPU as well as retention stats volition move updated every v seconds. You tin also tape this information to analyze CPU as well as retention utilization over a flow of fourth dimension to uncovering issues as well as performance stats. Simply redirect output of prstat ascendancy to a file. If y'all are interested inwards farther reading than 2nd chapter from Java performance book, is around other bully read on this topic, which discusses almost CPU utilization, retention utilization, network I/O utilization as well as disk I/O utilization on all major functioning arrangement including Windows, Linux, as well as Solaris.

Some of the useful choice of PRSTAT ascendancy inwards Solaris:

Following are around of the useful options of prstat utility, worth remembering.

interval   You tin define interval inwards seconds afterward which prstat volition update CPU as well as retention utilization
-s            To sort the output of prstat, y'all tin sort output of prstat ascendancy inwards Solaris on CPU, pri, rss, size, fourth dimension columns.
-c             To run prstat inwards continuous mode, which impress novel stats afterward specified interval inwards novel lines instead of overwriting existing details, this can  be used to tape prstat output over flow of time. yesteryear running prstat into continuous way nosotros tin generate useful reports which shows CPU as well as retention utilized yesteryear Java procedure yesteryear an hour, a twenty-four sixty minutes flow or a calendar week depending upon duration on which y'all run prstat inwards continuous mode.

Another ascendancy which tin move used to uncovering retention utilization of a procedure inwards Lord's Day Solaris operating arrangement is "pmap". but at that spot is 1 limitation of pmap command, y'all tin alone run pmap ascendancy amongst the user id which is used to start the corresponding Java process, other wise y'all volition acquire permission denied fault equally shown below :

pmap 29389
pmap: cannot examine 29389: permission denied

pmap ascendancy inwards Solaris shows address information of a Java process

That’s all on How to uncovering CPU as well as Memory usage of a Java computer program in Solaris. If y'all are working inwards Linux surroundings as well as don’t accept access to prstat procedure monitoring utility, y'all may desire to depository fiscal establishment check top as well as pstree, which are Linux equivalent of Solaris prstat. On closing noted, Java performance mass yesteryear Charlie hunt and Binu John mentioned inwards my listing of must read books for Java developer, has several techniques as well as ascendancy to uncovering retention as well as CPU utilization inwards Windows, Solaris as well as Linux. If y'all are serious almost mastering performance tuning as well as benchmarking Java application, they y'all should pass around fourth dimension amongst this book. One of the best mass for performance monitoring as well as tuning Java application.  At the rattling to the lowest degree y'all tin plug JConsole to your Java application as well as monitor retention usage, thread usage as well as deadlock

Further Learning
Java Memory Management
10 Hotspot JVM options Java programmer should know

Sumber https://javarevisited.blogspot.com/

0 Response to "How To Honor Cpu As Well As Retentivity Used Past Times Coffee Procedure Inwards Solaris – Prstat Ascendence Example"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel