Sponsored Links
J2EE Tutorials
- Why It is Important To Focus On Java Exceptions For Your Programs
- Important Features of Java - Multithreading, AWT
- What You Should Know About Java XML
- What You Can Do To Deal With Java's Memory Retention Problems
- Java Virtual Machine
- Java Overview
- How To Use Java DB as Your Client Mobile Database
- How To Run J2ME Programs on Palm Devices
- Quickly Develop Java Programs With Tapestry
- A Java TOC2 Class Which Can Contact Aim
- How To Perform Class Loading With Java
- How To Develop RFID Applications In Java
- Determine the Effectiveness of your Java Software
- How To Create High Quality Tables With JavaScript
- How To Create a Java Server Application
- How Code Reviews and PMD Can Crush Bugs In Your Code
- How a Profiler Can Improve Your Java Applications
- Antipatterns In Java Programs
- JSP Basics
- Servlets Advanced
Tutorials
J2EEDetermine the Effectiveness of your Java Software
Determine the Effectiveness of your Java Software
How To Determine The Effectiveness of Your Java Software During Development ? Trying to use a precise product simulation to test your Java software can be a very expensive process. There are a number of tools available on the market which can run automated tests, and they will allow you to test the efficiency of your application.
Many teams fail to address performance issues during development, and this can cause the Java application to crash on the initial tests. If programmers can effectively test their applications as they are developed, this could solve a large number of problems.
Two things that programmers must address during the development process is CPU queries and open cursors. By testing these two things during the development process, you will be able to save time in the creation of your Java programs. The first thing we will want to look at is open cursors. If you leave your database processing cursors open, and fail to provide specific closing instructions, they will soon max out and cause problems. When you perform tests, there is a basic query you can use which will look for cursors which are open. You will want to use this:
select s.SQL_TEXT , count(*) from v$sql s, v$open_cursor oc
where oc.hash_value = s.hash_value
group by s.SQL_TEXT having count(*) > 1
The query will tell you exactly which cursors are open. If certain cursors are not closed, the count for these queries will continue to increase. After you've found the query, fixing the code will be simple. The next thing you will want to pay attention to is CPU queries. One feature you can use to look for CPU queries is called the V$sqlarea view. It features a number of columns which will allow you to find queries which are memory intensive. The CPU_TIME feature will determine the number of microseconds that the SQL uses for parsing and execution.
Another feature that you will want to be familiar with is the RUNTIME_MEM. This feature will determine the amount of memory that will be used during the initiation of a cursor. There are clauses which will use up a sizeable amount of your CPU's resources, and an example of this would be the ORDER BY and % clauses. As of this time, there hasn't been a method developed to effectively deal with these queries. However, if you are aware of them during the testing phase, they can reduce the number of queries in your program.
There are a number of statements which will put a large amount of pressure on the Java Virtual Machine. They will also put pressure on your operating system. One example of this is the use of a large number of System outs. To solve this problem, you will want to make a comment about all the system printout statements before you begin running tests. Running code without a print statement will cause your application to move extremely fast, even if it is only using a small percentage of the CPU. There is also data that will need to be collected during the test.
If you run your programs in a *inx environment, you will want to make sure you collect information about the operating system. The *inx systems will use /proc files in order to learn about kernel data. The proc pseudo system will track all the operations on your machine simultaneously. It will also store information about these processes. When you get ready to run a load test, you will want to choose the API of your program which is the most memory intensive. You can start the test with about 100 users and let it run for approximately 20 minutes. As the test is in process, you will want to utilize the UPTIME command process load average information about your operating system.
It is important to make sure you don't have too many operations lined up for the CPU. In addition to this, it is also important to make sure you have enough operations in progress. The ideal load should be between 2 and 3. As the test progresses, you will want to slowly increase the number of users. As you do this, you will want to watch the memory statistics, load averages, and CPU utilization information. This is the best method for testing your Java programs during their development.
Comments
Manish Madhukar said:

|
::) Hello! I am interested to know more about : How to determine effectiveness of Java Application. I am beginer to use java to develop my appplications. |
Sponsored Links
