How To Uncovering Cpu In Addition To Retentivity Used Past Times Coffee Procedure Inwards Solaris – Prstat Ascendence Example

We oft take away to abide by CPU together with retentiveness utilization of a particular Java procedure inwards gild to acquire closed to performance stats, capacity planning or only to empathise the electrical current charge on the system. Performance monitoring together with testing is an integral role of whatsoever Java application development, especially if yous are working inwards high-frequency trading space. In gild to arrive at a performance problem, yous convey to abide by them commencement together with noesis of correct tools together with commands helps there. One of the master copy motility of miserable application performance is it Java or whatsoever other procedure is exhaustion of of import resources similar CPU together with memory. Monitoring CPU together with retentiveness utilization of your Java procedure give yous closed to useful insight similar what is the normal retentiveness together with CPU utilization, when are yous getting spikes inwards CPU together with retentiveness consumption. If  heap memory is constantly increasing over fourth dimension than it’s an indication that your Java application may convey a retentiveness leak. 

In this Java performance tutorial, nosotros volition acquire nigh ii most mutual Solaris commands prstat together with pmap to abide by CPU together with retentiveness utilization of Java process. prstat is a procedure monitoring tool easily available inwards whatsoever Solaris systems including SPARC together with x86 boxes, which provides useful statics of CPU together with retentiveness utilization of a process. 

For other systems e.g. windows yous tin give the axe work windows chore director for CPU monitoring together with Linux yous tin give the axe work top ascendence for same purpose. By the way, yous tin give the axe also cheque out Java performance yesteryear Charlie Hunt together with Binu John, it is immensely helpful for Java performance monitoring together with tuning. This is the book, which gives yous correct sort of tools together with noesis required to abide by performance stats for Java application.



Solaris ascendence to abide by CPU together with Memory utilization of Java process

We oft take away to abide by CPU together with retentiveness utilization of a particular Java procedure inwards gild to  How to abide by CPU together with Memory used yesteryear Java procedure inwards Solaris – prstat ascendence exampleprstat ascendence inwards UNIX, specially inwards Solaris tin give the axe endure used to abide by retentiveness together with CPU consumption of a Java application. prstat needs, procedure id to demo statics of particular process, which tin give the axe endure obtained yesteryear using ps ascendence inwards UNIX, equally shown below.

1. Find the PID of Java process

ps -ef | grep "MyJavaSever"

2) Find CPU together with 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 matter is to empathise output of prstat command, ii columns which are most of import are RSS and CPU. If yous await human page for Solaris prstat command, RSS denotes full amount of physical retentiveness used yesteryear the process together with CPU denotes the full percent of CPU used yesteryear that Java process. RSS stands for Resident Set Size together with shows full physical retentiveness used yesteryear the procedure on Kilobytes(K), Megabytes(M) together with Gigs(G). On the other hand, nosotros convey closed to other retentiveness stats denoted yesteryear SIZE which shows the full size of virtual retentiveness used yesteryear Java procedure or whatsoever other procedure including mapped files together with devices. SIZE denotes the size of virtual retentiveness 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 together with running.

PRI denotes priority of your Java process. Higher the number agency Higher the priority of Java procedure yous are monitoring.

You tin give the axe encounter that prstat is real useful ascendence together with also easily available on almost every Solaris machine, It response telephone substitution questions similar How much CPU together with retentiveness is currently utilized together with which procedure are using those. It also provides useful details related to process/threads. You tin give the axe also run prstat command amongst an interval equally inwards higher upwardly event CPU together with retentiveness stats volition endure updated every 5 seconds. You tin give the axe also tape this information to analyze CPU together with retentiveness utilization over a catamenia of fourth dimension to abide by issues together with performance stats. Simply redirect output of prstat ascendence to a file. If yous are interested inwards farther reading than minute chapter from Java performance book, is closed to other corking read on this topic, which discusses nigh CPU utilization, retentiveness utilization, network I/O utilization together with disk I/O utilization on all major performance organization including Windows, Linux, together with Solaris.

Some of the useful selection of PRSTAT ascendence inwards Solaris:

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

interval   You tin give the axe define interval inwards seconds afterwards which prstat volition update CPU together with retentiveness utilization
-s            To sort the output of prstat, yous tin give the axe sort output of prstat ascendence inwards Solaris on CPU, pri, rss, size, fourth dimension columns.
-c             To run prstat inwards continuous mode, which impress novel stats afterwards specified interval inwards novel lines instead of overwriting existing details, this can  be used to tape prstat output over catamenia of time. yesteryear running prstat into continuous trend nosotros tin give the axe generate useful reports which shows CPU together with retentiveness utilized yesteryear Java procedure yesteryear an hour, a hateful solar daytime or a calendar week depending upon duration on which yous run prstat inwards continuous mode.

Another ascendence which tin give the axe endure used to abide by retentiveness utilization of a procedure inwards Dominicus Solaris operating organization is "pmap". but at that topographic point is 1 limitation of pmap command, yous tin give the axe entirely run pmap ascendence amongst the user id which is used to start the corresponding Java process, other wise yous volition acquire permission denied fault equally shown below :

pmap 29389
pmap: cannot examine 29389: permission denied

pmap ascendence inwards Solaris shows address information of a Java process

That’s all on How to abide by CPU together with Memory usage of a Java programme in Solaris. If yous are working inwards Linux surroundings together with don’t convey access to prstat procedure monitoring utility, yous may desire to cheque top together with 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 together with ascendence to abide by retentiveness together with CPU utilization inwards Windows, Solaris together with Linux. If yous are serious nigh mastering performance tuning together with benchmarking Java application, they yous should pass closed to fourth dimension amongst this book. One of the best mass for performance monitoring together with tuning Java application.  At the real to the lowest degree yous tin give the axe plug JConsole to your Java application together with monitor retentiveness usage, thread usage together with deadlock

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

Belum ada Komentar untuk "How To Uncovering Cpu In Addition To Retentivity Used Past Times Coffee Procedure Inwards Solaris – Prstat Ascendence Example"

Posting Komentar

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel