View RSS Feed

Advanced Java

Advanced Java programming.

  1. Java memory management

    by , 02-18-2012 at 03:22 PM
    There are 2 categories of Java memory management problems which are as following:

    1. In-complete deallocation
    2. Pre-mature deallocation

    Incomplete deallocation has been divided into 2 subclasses which are:

    1. Desing bugs
    2. Coding bugs

    Coding bugs are considered to be dependent upon language whereas design bugs are not language dependent. They are programming mistakes. Usually programmer is involved in handling the memory ...
    Categories
    Memory
  2. Performance improvement of a Java application

    by , 01-08-2012 at 12: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,
    ...
  3. Unnecessary Object Creation with Immutable Objects

    by , 11-29-2011 at 11:05 PM
    Programmers are often not aware of how to create objects that can be reused. The key to understanding how to create reusable objects is that they must be immutable. So for example if you a running a loop in which each loop a string instance is required, rather than create a new instance every time it executes, you simply reuse the existing instance.

    Rather than create a new String instance.

    Java Code:
    public void BuildingLoop{
    	int total = 10;
    	
    	for(int i=0;
    ...
  4. Unnecessary Object Creation with Mutable Objects

    by , 11-29-2011 at 10:59 PM
    Continuing with our last tip on immutable objects, we now look at re-using mutable objects. Although you cannot modify a mutable object, you can avoid unnecessarily waste memory by reusing the existing instance. So consider for example mutable Date objects. Once the values are computed, they are never modified. So for example if you a running a loop in which each loop a string instance is required, rather than create a new instance every time it executes, you simply reuse the existing instance. ...