Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Improving the Performance of Java EE Applications

Yolande Poirier-OracleJun 16 2015 — edited Aug 8 2016

by Josh Juneau

Incorporate performance tuning into your development lifecycle.

Java Magazine March/April 2015 Edition

Imagine that your application, after months of development time and lots of testing, is finally ready for production deployment. The application goes live, and for the first few minutes everything seems like a success.

Suddenly you receive a phone call from one of the users telling you that they can’t access the application, because it appears to load indefinitely. Moments later you receive another call, and yet another. It seems as though your application doesn’t allow concurrent access to enough users. This is a nightmare scenario in which the application development team must make critical performance tuning decisions under the gun, and they must make each of the changes to the production environment directly.

Where do you begin in this situation? What could be wrong? Is a server configuration preventing enough connections for your production environment, or does the application code contain a bottleneck that causes the users to wait?

Many applications are not tuned for performance until after they’ve been put into production. Unfortunately, many organizations do not deem performance tuning to be an essential part of the development lifecycle, but rather, treat it as a triage step when things go wrong. To make matters worse, Java EE performance tuning can sometimes be much like finding a needle in a haystack. The cause of the performance issue can lie just about anywhere, from the application source code to a server configuration.

In this article, you’ll see some of the processes that you can use for tuning your Java EE applications pro-actively, so you can try to avoid scenarios like this one.

Approaching the Beast: Proactive Tuning

Performance tuning should be made part of the standard development lifecycle. As such, applications should be designed from the ground up with performance in mind. To be forward-thinking about performance means to consider carefully all approaches for the implementation of application solutions, not just the fastest approach or the one that is easiest to implement. Java EE applications can be particularly difficult to develop around performance, because several points of contention in a Java EE environment can add performance burdens to an application.

The top performance issues experienced in Java EE application environments tend to be related to configuration issues and environment issues. Oftentimes, the applications themselves are coded fine, but the application server to which they are deployed is not tuned correctly or it is configured inappropriately for the applications or the intended user capacity.

To tune properly for a production employment, perform the following steps in the order listed:

  • Application tuning
  • Server tuning
  • Java runtime tuning
  • Server operating system and platform tuning

enterprise-juneau-f1.jpg

Next, focus on decreasing the chance of incurring performance issues after a production deployment.

Coding for performance. There are bevies of coding situations that might lead to performance overhead in a Java EE application. Java EE applications are executed concurrently, which can lead to bottlenecks, because users might be competing for resources such as web services or databases. Each remote call can add latency, and processes such as serialization can be CPU-intensive, causing further performance degradation. With these kinds of issues in mind, you need to craft Java EE applications carefully, ensuring that proper resource handling is used.

An application’s performance tuning should begin with the source code. Even though the top causes of performance issues in Java EE applications point to the environment, proper coding can still play a key role in an application that performs well.

The following poor-coding practices, among others, can lead to performance issues:

  • Over-serialization and deserialization
  • Overuse of finalizers
  • Too much synchronization
  • Not discarding unused variables
  • Too many dynamic variables
  • Rampant use of System.out.printIn()
  • Sessions that are not released when they are no longer needed
  • Failing to close resources (for example, database and network connections)

Performing code reviews is imperative for reducing code that inhibits an application’s performance. While poorly crafted code can slip past multiple developers, the more eyes that examine it, the better. In addition to code reviews, more than one individual should run performance and load tests against an application, and compare results of current tests to those run previously.

enterprise-juneau-f2.jpg

Read the full article in Java Magazine at oracle.com/javamagazine

Comments

Grant Ronald-Oracle
There is no hard and fast rule but think if someone else was asked to maintain your form. Do you think it would be easy with all of these objects?
Check out http://otn.oracle.com/products/forms/pdf/bestpractices9i.pdf

Regards
Grant Ronald
Forms Product Management
391495
thank you very much for your replay

In fact I didn't expect the form to grow so quickly
I come from C an C++ and here in a couple of weeks
I have many datablocks, canvases,program units,...
I think I am going to split the form in 4 forms just to make them easier to maintain.

best regards
alejandro
275888
if it is on web deployment, the download time will be much longer if the form size is large. therefore, from support, from performance standpoints, the smaller the better, of course, to small you have too many files to manage too. so, the political conclusion is to make form just small enough to accommodate your business functionality while retaining the acceptable performance and maintainance level.
Shay Shmeltzer-Oracle
Actually the size of the FMB/FMX doesn't affect the download size when Web deployed, since the FMX is not downloaded to the client machine while Web deployed - it stays on the application server.
The FMX size will influence the memory consumption on the application server though. Bigger FMXs will require more memory.

What effects the download is the number of visible items that needs to be displayed.
However - I agree that you shouldn't be developing huge Forms, but rather break them according to functionality and how tight is the relationships between the activities are.
275888
Shay,

I understand the GUI components downloading, the trigger codes will stay in middle tier, right?

When you said form not downloaded to client, you means the trigger code not downloaded to client, right?

Therefore I admit my wording not inaccurate enough, but a 'downloading' here is a common jargon though.
Shay Shmeltzer-Oracle
Actually, the graphic components are not downloaded to the client. All that the client gets is a set of meta-data instructions on which item to draw where.

This is the great thing about Form's Web architecture - you only download one applet and this applet can draw any Forms user interface just by following the instructions it gets from the application server.

More on the Forms Web Architecture is on the Forms Upgrade Center - http://otn.oracle.com/formsupgrade
275888
Shay,

Thanks. But it seems to me this is right after forms 9i, am I right? Before 9i, it is different.

Thanks again.

John G. Feng
Shay Shmeltzer-Oracle
It is the same for 6i as well.
6970
I think visible items isn't quite right. As far as i know it's items on visible canvases. So if you have a tab-canvas, all items on the canvas are sent to the applet. No matter if they are visible or on a hidden tabpage.
Shay Shmeltzer-Oracle
Correct. This is something that you need to watch for - there is a workaround for this if you place the items on stacked canvases that map to tabs. More on this in the tuning guide for Oracle Forms on the Web.
391495
> understand the GUI components downloading, the trigger > codes will stay in middle tier, right?

what I am trying to do is to put all the code of the triggers in program units, or if I can, directly to the database as store procedures or functions. In this way the form is smaller and require less memory in the application server.
Also I am trying to avoid post-query triggers, using views instead (just ready to be displayed). So my forms require fewer triggers and I am not querying many times (post-queries).
Another thing that I do, is to use the where clause on the block to filter the view,
and the orderby clause I use in the block (because is a reduced set) and not on the database view

Alejandro


1 - 11

Post Details

Added on Jun 16 2015
0 comments
13,029 views