An article on Dzone's JavaLobby Three Common Application Performance Challenges for Developers written by Bhaskar Sunkara presents a high-level overview of some considerations for Java application engineers. The following is a concise summary.

The 3 main points are:

  1. Memory Leaks
  2. Slow SQL
  3. Threading/Synchronization

Let's look at these in reverse order. Why? Because threading and synchronization is much more interesting as it relates to performance testing and tuning. Also, the article doesn't really go into much detail about memory leaks.


Threading and Synchronization

Java allows many concurrent threads to be running in order to increase the efficiency of processing. That's a standard concept of all modern computer theory that began in operating systems with "parallelism". Properly shuffling program needs to processors or data resources has been performance engineering 101 for 50 years.

The ability for Java to take this concept out of the operating system and down to the level of threads in an application is intriguing, but it is also where performance challenges arise. There is a keyword in Java that programmers can employ - "synchronized". It forces order on concurrent thread execution to eliminate contention for shared resources in memory (e.g. objects).

The performance problem is due to the numerous conflicts and contentions over the shared resources. Regardless how "concurrent" you think your execution of code may be, there will always be a bottleneck when the processing reduces to sequential execution of requests for those resources in memory. Again, it is the same contention we have been fighting since mainframes started using complex algorithms to squeeze more processing out of CPUs while a program was waiting for slow disk reads to return. The bottleneck has moved to a new place, and the complexity is a magnitude worse.

The website Java Performance Tuning has several tips relative to synchronization. There is a bullet point attributed to Jack Shirazi, the author of the book and presumably the website Java Performance Tuning, stating, "Avoid synchronization where possible."

On the same website, Karthik Rangaraju is attributed to say:

  • Use Djikstra semaphores (synchronized acquire()/release()) to control access to a finite pool of resources.
  • Conditional events provide a more sophisticated version of the wait()/notify() mechanism which avoids some potential problems of that mechanism.

Brain Goetz gives us 4 tips about avoiding synchronization deadlocks:

  • Deadlocks are difficult to identify from code analysis, and can occur unexpectedly.
  • Always acquire locks in the same order to avoid one common cause of deadlocking. If you can guarantee that all locks will always be acquired in a consistent order, then your program will not deadlock.
  • Try to avoid acquiring more than one lock at a time (though this is usually impractical).
  • Keep synchronized blocks of code as short as possible.


Slow SQL

Anyone that has worked with web applications can attest to a proven axiom that most performance issues center around the database. Bhaskar wisely jumps on that bandwagon too.

He focuses on the Object Relational Mapper (ORM). The premise is a common trade-off between ease of use and performance. Most developers that are concerned with getting more speed will avoid added layers of architecture and extra tools that do some of the work for you. Arguably, Java itself is designed to make certain parts of the development cycle easier for coders; however, the ORM can be particularly expensive.

The idea is to allow the ORM to handle the inherent mismatch between objects and a relational database table structure. The "ObjectRelationalImpedanceMismatch" is label for a set of problems encountered when using a relational database to store (the state of) objects from software written in an object-oriented programming language.

While abstracting the translation is a good thing for programming productivity, Bhaksar tells us that it puts, "...a significant weight on an application's performance". Makes sense to me. There is no further explanation of quantification of the ORM impact.

C2.com has a page in their wiki called Object Relational Mapping Costs Time And Money that states

This runtime response time cost has been anecdotally observed by some, with caveats, to be anywhere from twice to an order of magnitude more...

Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".


Memory Leaks

Bhaskar talks about the advantages of Java handling the memory model for you, but that it isn't perfect. His main point is that heap management is problematic when a developer does not "relieve all references to a object". The issue stems from the creation and destroying of unused objects because Java's memory management puts these unused objects in a heap and that heap continues to grow as your application runs.

He states, "...your heap builds up and your app comes to a grinding halt". Intuitively, it is understandable that the memory available is consumed by this heap; thus, the leakage causes other important application processes to be starved for memory. The performance challenge sounds rather easy to address - REMOVE ALL UNUSED OBJECTS FROM YOUR CODE.

Bhaskar touches on the use of heap dumps and profilers to find memory leaks. He does not explain how to use these tools, and he says both have drawbacks. He says the heap dump helps you identify objects, but it does not allow finding the root cause.

Using a profile in conjunction with a heap dump doesn't improve the diagnosis process significantly. Neither provide the functionality to determine what is causing the leak. This article leaves us wanting more information, as exhibited by a few comments left by other developers saying things like, "Was hoping for a bit more insight into tackling performance issues and/or designing to prevent them, gleaned from and explained through real-life experiences. This article is very superficial."

Conclusion

Web performance challenges exist no matter what language you code - Java, PHP, .NET, Python, etc. There are simply some problems that always will exist, especially around the database.

This article shares 3 of the most common issues for Java developers. If you have comments or suggestions, this topic can easily grow into a whole series of posts that we can put together to help web coders. Thoughts?



  1. sadiaromi on Wed, 05/22/2013 - 01:52

    This is a great inspiring article.I am pretty much pleased with your good work.You put really helpful information. Keep it up.
    BestCustomWriting.com at Stumbleupon

    • sadiaromi on Thu, 07/11/2013 - 01:16

      i really inspire from performance and AustralianWritings services are available for students and teacher who want it immediately

  2. pooiyttre on Sat, 05/04/2013 - 03:22

    This article leaves us wanting more information, as exhibited by a few comments left by other developers saying things like, "Was hoping for a bit more insight into tackling performance issues and/or designing to prevent them, gleaned from and explained through real-life experiences.
    RDF Group

    • sadiaromi on Thu, 07/11/2013 - 01:12

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:11

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:11

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:10

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:08

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:07

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:01

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:00

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:00

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:00

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 01:00

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

    • sadiaromi on Thu, 07/11/2013 - 00:59

      Josh Marotti commented on Bhaskar's post by saying: "I find that unless you have everything setup perfectly, it is more work to get it working the way you want than just writing the damn queries/rowmappers by hand".

  3. pandawill567 on Mon, 04/22/2013 - 01:53

    H Good post.This is a very nice blog I wonder why the other of this sector do not notice this. am sure this post has helped me save many hours of browsing other similar posts just to find what I was looking for. Thanks! Haipai I9377

  4. pooiyttre on Sat, 04/20/2013 - 04:20

    Most developers that are concerned with getting more speed will avoid added layers of architecture and extra tools that do some of the work for you.
    It recruitment

  5. JerryS on Fri, 04/19/2013 - 03:12

    Such java programming seems difficult for new comers, but java looks more beautiful than flash. Wedding Photography Brisbane

  6. hopar111 on Thu, 04/18/2013 - 04:50

    Thanks for sharing nice information with us. i like your post and all you share with us is uptodate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job.
    http://blackzonestudio.com

  7. james1122 on Wed, 04/17/2013 - 04:14

    I high appreciate this post. It’s hard to find the good from the bad sometimes, but I think you’ve nailed it! would you mind updating your blog with more information?
    grezed

  8. sadiaromi on Tue, 04/16/2013 - 00:07

    I actually enjoyed reading it, you will be a great author.I will ensure that I bookmark your blog and will come back in the foreseeable future.
    writing an essay

  9. pandawill567 on Mon, 04/15/2013 - 00:27

    TENVIS IP camera, you can keep an eye on your babies, senior citizens or pets on your smartphone anywhere anytime. TENVIS Techonology Co., Ltd. has its own factory that produces quality wireless IP cameras, indoor and outdoor cameras, p2p, megapixel and h.264 cameras, etc. We have extensive resources of users and our independent development of the industry is widely acclaimed by many B2B, B2C platforms. You can buy TENVIS products from authorized partners on eBay and Amazon. If you are interested in becoming a TENVIS reseller or distributor, please contact us.

  10. saonbd on Wed, 03/27/2013 - 10:58

    Hey, buddy, I've not discovered the best way to subscribe I am a long time in the past I read your blog and it has extended been saying that you are an excellent author.help with writing a resume

  11. opcom on Mon, 03/25/2013 - 22:29

    Before BMW 4 Department of concept car mvci scanner was unveiled in Detroit Motor Show, the overseas media exposure again no camouflage spy photos of the production model of the BMW 4 Series Coupe. It is reported that the new car will be in July to start production, and is expected to officially listed at the end of this year the concept of Sale look no pseudo-spy, the production version of the BMW 4 Series Coupe and not previously published version of the fashion avant-garde, the front bumper simplified kidney intake grille, black family also appears to be more conservative. Side view, the concept car body curve as well as sharp waistline are the production version inherited. Sports styling is very prominent five-spoke wheels are also retained, people think BMW practice very kind. At the same time, their body size than the BMW 3 Series wider, longer, lower, will also greatly increase the wheelbase cabin rear passenger space. Tail aspects of the production car is put on a more simple design of the rear bumper, tail around the layout of the exhaust pipe is not a concept car double row of majestic momentum. In addition, you can see the tail of the "435i" logo. Power, the BMW 4 Series Coupe is expected to be powered by a 245 hp 2.0T engine and 306 horsepower 3.0T engine. The 3.0T engine version of the model will be named BMW 435i. Match the transmission part of the six-speed manual or eight-speed automatic transmission. In addition, the car will also offer four-wheel-type choice. It is reported that BMW 4 Series listed, BMW will launch a high-performance version of the M4. Sources also claim that the future the 4 Department GranCoupe four versions will push the market for consumers to choose. BMW 4 Series COUPE concept car unveiled attract too much attention, sharp and dynamic appearance is 4-one of the highlights of the models, while benefiting from the advantages of the mvci interface new 3 Series platform, which makes 4 series have the same pleasure handling the Cabriolet models designed to upgrade again, the real car waiting for next year's Detroit auto show debut. Recently, an official picture of the BMW 4 Series Convertible car accident exposure, but the new car to be released in the coupe version will be released after six months, is expected to wait until next year's Detroit auto show. It is noteworthy that 4 Series Convertible basic car continues before 4 Department of concept car design, and continue to use the the hardtop convertible structure from the official pictures of 45-degree view of the rear side of this model, as before guessing the amount of The reference production version 4 Department 4 Department of the styling of the concept car. Strong side straight waist and door to create a long the BMW coupe tradition of dynamic and elegant temperament, fender inverted "L" shaped air intakes is a new design element. The taillight is equally traditional L-style, but the inner cavity design more artistic effect, the unilateral double the design of the exhaust pipe that this may be the vehicle entry-level models, the high-level version should correspond bilateral exhaust pipe style. In addition, the convertible version of the Fourth Series is still the same and the current model, using three collapsible hardtop design, the shorter folding mechanism and optimized time-consuming. Reference 4 Department of concept cars, 4 series convertible version of the front face shape even as one of a new family of design will be introduced to the headlights with air intake grille. However, compared to the positioning more sporty 4 Department headlight styling system more sharp, while the front bumper also to show his movement style. Reference 4 Department of concept cars, 4 series convertible version of the front face shape will be introduced headlights with air intake grille with one of the new family of design power, 4 line models in conjunction with the new generation 3 Series share, a series of four-cylinder supercharged engine, The new engine has a displacement of 2.0 liters and single turbo twin-scroll turbocharger, the maximum power of 243 hp and maximum torque of 350 Nm. In addition, BMW's classic inline six-cylinder engine is still serving in the Fourth Series, the engine matching twin turbochargers, maximum power of 302 horsepower. Top dynamic configuration of M4 will be powered by the same inline six-cylinder engine, but the maximum output horsepower to 448 horsepower. In addition, 4 Department will also benefit from the new 3 Series advances in the lightweight chassis, the chassis of aluminum alloy components increased, NEXIQ not only to reduce vehicle weight, but also can enhance the performance and handling performance. "Carnival Night" on February 28, Changan Ford officially announced the pre-sale price of the new Carnival official pre-sale price of the new car 8.29-11.99 million, and is expected to be officially listed at the Shanghai Auto Show. The new Fiesta 1.5L power a total of 11 models will be introduced, including 5 models sedan version 6 hatchback edition models, is also expected to launch ride 1.0GTDI three-cylinder turbocharged direct injection engine models.

  12. JerryS on Mon, 03/25/2013 - 01:58

    Java script looks good and more seo friendly than Flash script. But the tough part of JS is coding and many internet shopping cart software supports JS. So we need no technical knowledge to implement JS on a shopping cart.

  13. james1122 on Wed, 02/27/2013 - 07:43

    Thanks for your insight for your fantastic posting. I’m glad I have taken the time to see this.
    free3creditreports.net

  14. pandawill567 on Wed, 02/20/2013 - 01:47

    Thanks for sharing.I really appreciate it that you shared with us such informative post,great tips and very easy to understand. android tablets

  15. hyjuj5 on Wed, 02/13/2013 - 00:20

    We help leaders make distinctive, lasting and substantial enhancement to the performance of their organizations.kariyer

    • rabqa on Fri, 02/22/2013 - 23:27

      Gotta agree that comment spam is one of the worst thing that can happen to your website
      Upholstery Repair

    • joay111 on Thu, 02/14/2013 - 02:48

      This is a brilliant blog! I'm very happy with the comments!..
      Relationship Tips by Prestagen

  16. pooiyttre on Tue, 02/12/2013 - 00:43

    The issue stems from the creation and destroying of unused objects because Java's memory management puts these unused objects in a heap and that heap continues to grow as your application.
    media contacts

  17. pooiyttre on Mon, 02/11/2013 - 06:25

    The processing reduces to sequential execution of requests for those resources in memory. Again, it is the same contention we have been fighting since mainframes started using complex algorithms to squeeze more processing out of CPUs while a program was waiting for slow disk reads to return.
    Web Design Bristol

  18. pooiyttre on Fri, 02/01/2013 - 05:47

    This article leaves us wanting more information, as exhibited by a few comments left by other developers saying things like, "Was hoping for a bit more insight into tackling performance issues and/or designing to prevent them.
    ppc management

  19. treymakesdc on Thu, 01/31/2013 - 22:22

    Rush to Chiropractic Austin if you are tormented from stiff muscles and joints or numbness in your body. Get healed with significant results through natural treatments of Chiropractor Austin without undergoing any operation. Austin Chiropractor magical remedies will rid you of all the agonies in your body that's making your life harder.

  20. pooiyttre on Thu, 01/31/2013 - 04:32

    The Java that programmers can employ - "synchronized". It forces order on concurrent thread execution to eliminate contention for shared resources in memory.
    guest blog post service

  21. pooiyttre on Wed, 01/30/2013 - 00:49

    The project human resources to focus on Development Items and Business Logic Quick Testing and Integration of Tools and Libraries Build and Testing Procedures.
    Access a cloud and acloud

    • JerryS on Wed, 02/06/2013 - 01:46

      Thanks for the clear, concise and well written instructions!! These simple steps made all the difference in the world. Fire Risk Assessment

      • sadiaromi on Thu, 07/11/2013 - 01:13

        Thanks for the clear, concise and well written instructions!! These simple steps made all the difference in the world.

  22. pooiyttre on Fri, 01/04/2013 - 01:06

    The memory model for you, but that it isn't perfect. His main point is that heap management is problematic when a developer does not.The issue stems from the creation and destroying of unused objects because Java's memory management puts these unused objects in a heap and that heap continues to grow as your application runs.
    It recruitment

    • furqan on Sun, 01/27/2013 - 23:56

      For a greater understanding of the quality replica brand watches that we sell, please browse through the testimonials on the site. www.highereducationplans.com

    • usman8 on Thu, 01/24/2013 - 03:56

      Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. edu today

      • ahmad222 on Tue, 01/29/2013 - 00:40

        How can we avoid Fibromyalgia? It is very painful diseases. franklipani.com , gwac-az.com , holisticstressmanagement.com

    • morkel on Thu, 01/17/2013 - 05:38

      I truly found to this unique and original site recently. I was seriously grabbed with the part of assets you've got here. Big thumbs up for creating such fantastic website!http://perfecthvactraining.com/

    • morkel on Tue, 01/15/2013 - 22:40

      How do you become this good? It's incredible to find out someone place such a lot of interest towards a topic. I am thankful I came across this. I am truly satisfied I spent the time to learn on over the very first section. sutterhealthpro.info

    • ketimano on Fri, 01/11/2013 - 08:22

      As an internet designer – you must be excited with magento website design Windows eight. you'll be able to currently build native apps in html/css/javascript and deploy them via the app store for each the desktop and phone.

      • nobelboy on Tue, 02/26/2013 - 21:30

        Performance testing mitigates your performance risk by measuring the ability of your application and your architecture to meet the customer's performance expectations before it is exposed to the user community.
        apple repair

    • Anantraj on Sat, 01/05/2013 - 05:04

      Inventure India is a management consulting firm has an unparalleled depth of knowledge and resources combined with functional and industry expertise for geographical reach. We help leaders make distinctive, lasting and substantial enhancement to the performance of their organizations.
      Franchise company
      Best franchise
      Franchise investment outside india
      franchising marketing

      • rabqa on Tue, 02/26/2013 - 09:53

        I just have to tell you that you have really outdone yourself with this quality article presentation. I am very fascinated with the points you make here and I am in complete agreement with you.
        Upholstery Repairs

        • nobelboy on Tue, 02/26/2013 - 21:31

          Performance testing mitigates your performance risk by measuring the ability of your application and your architecture to meet the customer's performance expectations before it is exposed to the user community.
          la page web

          • sadiaromi on Thu, 07/11/2013 - 01:14

            Thanks for the clear, concise and well written instructions!! These simple steps made all the difference in the world.