≡ Menu

One important change in Memory Management in Java 8

Oracle’s latest edition for Java – Java 8 was released in March 2014. As usual, tons of new features have been added. There is one major change in the Memory management area that I want to discuss today.

“So long PermGen, Hello Metaspace !!”

Oracle has completely gotten rid of ‘PermGen’ and replaced it with Metaspace.

What is PermGen ?

Read More

So, when was the last time you monitored the CPU utilized by your Java application ? Perhaps ‘never’ ?. It is actually important to keep an eye on the CPU utilzied by your application. Your Application runs on a host (or hosts) that has one or more CPUs managed by the Operating System. The CPU resource is not unlimited (even though some developers and Administrators wish that were true).

Let’s dive into the 4 things you need to know about the CPU Utilization of your Java application.

1. Why do you care ?

Read More

Top 4 Java Heap related issues and how to fix them

Java heap related issues can cause severe damage to your application that will directly result in poor end user experience. Care must be taken to tune the Heap related parameters that suit your application. Out of the box default parameters are not enough.

Quick overview:

Java Heap is the memory used by your application to create and store objects. You define the maximum memory that can be for the Heap by specifying ‘-Xmx<size>’ java command line option (Example: ‘-Xmx1024m‘, where m stands for Mega bytes). As your application runs, it will gradually fill up Heap. JVM periodically runs a process called ‘Garbage collection’ (GC) which will scan the heap and clear objects that are no longer referenced by your application.One cannot request Garbage Collection on demand. Only JVM can decide when to run GC.

Let me walk you through four of the most common Java Heap related issues and how to fix them.

Read More

How to determine if my Unix Hardware is 64 bit ?

Use the following commands to determine the Hardware Architecture

AIX

bootinfo -y

SOLARIS

isainfo -vk

HP-UX

getconf HW_CPU_SUPP_BITS

or

getconf HW_32_64_CAPABLE

If the above command returns 1, hardware supports both 32 and 64 bit binaries

LINUX

grep flags /proc/cpuinfo

If the output of the above command contains the string “lm”, Hardware is 64 bit.

Example:

grep flags /proc/cpuinfo

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht

tm pbe nx lm constant_tsc pni monitor ds_cpl est cid cx16 xtpr lahf_lm

Note: 64 bit capable Hardware does not mean your OS is 64 bit. Generally, for backward compatibility, 64 bit capable Hardware can run 32 bit Software.

Very simple.

Add “–color” to your command

Example:

grep –color localhost /etc/hosts

127.0.0.1               loopback localhost   # loopback (lo0) name/address

 

The string “localhost” will appear in RED.

Note:

1. You need GNU ‘grep’ for this to work

2. Don’t use “GREP_OPTIONS” environment variable in your shell startup scripts to accomplish this. It can break several scripts.

More information can be found in this link: http://www.gnu.org/software/grep/manual/grep.html#Environment-Variables

All passwords are encoded within the WebSphere XML Configuration files such as resources.xml, security.xml etc.

In order to decode the passwords, you can use a freely available tool found at “http://www.sysman.nl/wasdecoder/”. Type in the encoded password without the {xor} when using this site.

Alternatively, you can use the PasswordDecoder classfile provided with WebSphere library. With WAS 6.1, the following command will do the trick.

java -classpath=WASHOME/deploytool/itp/plugins/com.ibm.websphere.v61_6.1.200/ws_runtime.jar com.ibm.ws.security.util.PasswordDecoder “password with {xor}”

(You need the double quotes around the password)

Enjoy

 

At the db2 prompt, use the command

list database directory

How to list all existing Schemas in a DB2 Database ?

Sometimes, you need to look at all the existing schemas in a db2 database. For example, when you try to connect to the database from your application, you might see a db2 exception stating that the database is not available. Once you confirm the database server is up and running, the next step is to check if the schemas you are using really exist. In this situation, listing all the schemas from a database server may be helpful.

First connect to the database via DB2 CLI (Command line interface) and then use the following query to list all the available schemas

First connect to the database vi DB2 CLI (Command line interface) and then use the following query to list all the available schemas

select schemaname from syscat.schemata

 

When the user cannot access your web application and instead sees a generic (and ugly) ‘Page cannot be displayed’, the root cause could range from simple typo in the URL to having exhausted the Thread Pool in the Application Web Container. The key to resolving this type of problem is asking the right questions well in the beginning of troubleshooting.

pagecannotbedisplayed

Pull up your sleeves, here are the top 8 reasons for this problem.

Read More

Let’s face it. No matter how much tuning one can do at various sub systems (Application Server, Web Server, Operating System, Database), when the code is bad, you are screwed. Poor coding can cost a company a lot, and in some cases can cost the company itself.

Before diving into the 9 blunders made by the development team, let me tell you that I have been a software engineer and I have personally made lot of these mistakes myself. It requires great deal of discipline to be vigilant about writing quality code. There is no other choice.

Without further due, here are the 9 blunders by the Development team that will make Production Support’s life miserable. Don’t make anyone’s life miserable.

Read More