View RSS Feed

Performance

Java Performance

  1. Checked and Unchecked Exceptions

    by , 02-18-2012 at 05:14 PM
    Checked exceptions: Programmers are facilitated by checked Exceptions so that to dealings with exceptions which could be thrown. Exception class has sub classes. Checked Exception examples are:

    • Arithmatic exception

    In a method when checked exception takes place, either program caught it or it passes to caller program.

    Unchecked exceptions: They are RuntimeException. Class Errors and subclasses of it are also unchecked.

    Example: ArrayIndexOutOfBounds ...
  2. High Load Web Servlets Performance Tips

    by , 02-18-2012 at 04:19 PM
    • Do not redirect request from the servlet. Always send requests directly from static resources to the web server using URL.
    • Use different web servers for dynamic and static content.
    • Use cache to store content.
    • Manage your RAM to cache content.
    • Use multiple JVMs to balance the load.
    • Limit the number of file descriptors.
    • Do not avoid logging to improve performance. It is more important.
    • Always monitor resources.
  3. JMS Performance Tips

    by , 02-18-2012 at 04:17 PM
    • To avoid message queue, start consumer before producer.
    • To process messages, use ConnectionConsumer with ServerSessionPool.
    • Close all resources explicitly like connections, sessions, objects etc.
    • Non-transactional as well as transactional sessions should be used for non-transactional & transactional messages.
    • Destination parameters shall be tuned.
    • For messages to be received asynchronously, MessageListener shall be implemented.
    • Select NON_PERSISTENT ...
    Categories
    Performance
  4. EJB Performance Tips

    by , 02-18-2012 at 04:16 PM
    • Tune EJB calls. They are expensive.
    • Use Plain Java Object (POJO), when you do not need an EJB.
    • If EJB client and EJB are deployed on same JVM, then use Local Interface.
    • Multiple entity beans must be wrapped in one session bean to reduce remote calls.
    • Use transient with unnecessary data variables to avoid network overhead.
    • Always cache to EJBHome references so that do not need to lookup JNDI each time.
    • Set transaction time out.
    • Use ...
    Categories
    Performance
  5. Servlet Performance Tips

    by , 02-18-2012 at 04:14 PM
    • Cache static data using jspInit() method.
    • Release static data in jspDestroy() method.
    • To concatenate string use, StringBuffer.
    • Do not use println() method.
    • Do not use PrintWriter to send binary data. Use ServletOutputStream.
    • Always flush data in sections.
    • Use getLastModified() method to handle browser and server cache.
    • Use application server cache.
    • Use session in following order: HttpSession, Hidden fields, Cookies, URL rewriting. ...
    Categories
    Performance
  6. JSP Performance Tips

    by , 02-18-2012 at 04:13 PM
    • Cache static data using jspInit() method.
    • Release static data in jspDestroy() method.
    • To concatenate string use, StringBuffer.
    • Do not use println() method.
    • Do not use PrintWriter to send binary data. Use ServletOutputStream.
    • Do not use sybchronized blocks in service method.
    • Do not create session object with directive <%@ page session="false" %>
    • Scope of ‘useBean’ action should be minimized.
    • Minimize the use ...
    Tags: jsp, performance Add / Edit Tags
    Categories
    Performance
  7. Performance improvement of a Java application

    by , 01-08-2012 at 01:45 PM
    Follow these steps to improve performance of your Java application.

    • Always Pool valuable system resources like threads, database connections, socket connections.
    • Optimize your I/O operations by using buffering when writing to and reading from files and/or streams.
    • Minimize network overheads by retrieving several related items simultaneously in one remote invocation if possible.
    • Apply the following performance tips in your code

    • Use ArrayLists,
    ...