JVM Performance

In Java, making your code running is just a part of the development. Aside from that, you must also consider the performance of your system. Your system should response immediately even at unusually high or peak loads. Therefore, you must be aware of the things your code might bring because Memory leaks, heap fragmentation and others are actually caused by your own code.

Here's a PDF file I found on the net on how to reduce time and space consumption in your Java Virtual Machine. This will help you on how to optimize your code and making your system OK even though the demand is beyond the normal usage. Click here to download.

Factorial Code Snippet

Here's a Java code example for Factorial. In this example, we will compute for the Factorial of 6 which is denoted by variable n:

int n = 6; // where n is a non-negative integer
int count=1, product=1, factor=1;
do{
product = product * factor++;
count++;
}while(count <= n);

System.out.println(n + "! = " + product);

How check your RAM information in Linux

To know your RAM/memory information. First, you need to be root. Then just type the following:

# su
# dmidecode --type 17