Vengatc techology logs

JVM instrumentation – Performance tuning

Posted in Architecture, java, JVM, Performance by vengatc on October 3, 2008

Performance monitoring

Sun has done an excelent work in integrating remote management into JVM. They have build in SNMP Agent like  capablity into the JVM. The SNMP OID is synonomous to the MBeans and SNMP MIB is synonomous to the MBean Server.

This beautiful capability allows you to connect to the JVM and monitor the crime we have done in the code with regard to the run time memory/CPU and thread utilization. I became a lover of this feature. I always thought to build this capability into the applications we build. This feature is a  real bliss for architects.

Head on Jump

To have a first hand experience with the JVM instrumentation , just follow the simple steps…

1. Have Java 5.0 installed in your system and create an java program that runs until you forcefully stop it. If you have a framework with threadpools, resource management etc.. it is a good example.

2. Run your java program with this additional parameter.

Java -Dcom.sun.management.jmxremote  xyz.jar

This command publishes the MBServer in the JVM as a RMI resource for the Jconsole to connect to.

3. Start Jconsole and connect to the Program in your connection dialogue box.

Jconsole will alow you to monitor the Memory used and the threads used. Identify deadlocks etc etc..

See the peformance scaling for an Enterprise Information Integration framework that i recently wrote.. This is a heavy ETL and EII kind of tool that aggregate data from multiple databases. You would difinitly need to have some performance numbers for its production run.  jconsole tool would help you prove the roboustness your ur framework by showing the memory and thread occupancy and how controlled they are admist heavy load on the framework.

Tagged with:

Flex and Cairngrom Architecture

Posted in Architecture, Flex, java by vengatc on October 3, 2008

Developing RIA with Flex fun..

What and why is RIA?

Like fashion industry technology also swings back and forth. Initial when client server architecture was introduced industry started moving in the direction of developing desktop based rich applicaiton which talks to the server. But later architecture matured and industry wanted many clients to access the application so it rediculously called the desktop application as thickclient. and industry stared moving in the direction of thin client funda like HTML and other dynamic web technologies. Now again industry started missing the richness in the traditional destop based thinkclient , and it also got bored with the HTML based request response model. This gave the birth of RIA… FLash and silverlight.

Their aim is to develop thin-think client that can run in browser and still hide all request response boaring stuff that webclients were experiencing.

Flex was the fourrunner in t his market.

Flex development nightmares?

Developing application with flex builder a sample flex program will all be a easy going task . But the real nightmare kicks in when the applicaiton grows big. When you want to build a real production system out of it. The front end MXML becomes really messy. You will have a single monolythic mxml file where we have to keep writing actionscripts and mxml. We can seperate actionscript into seperate file and mxml into multipel file but you will hit a point were you cry for framework.

Cairngrom would be your rescue.

What is cairngorm?

Cairngrom tries to bring in the tradional software engineering best practises in to the Flex applicaiton development.

It is a way you fit in your

1. Business Delegate

2. Service locator

3. Command

4. Model Locator.

5. Front controller

Kind of patterns in to your flex development. The time to adopt cairngorm frame is bit more but once it is done and when we start fitting in pieces it really pays of.

Following picture gives a architecture of a cairngrom based flex application.

For more details on cairngrom follow some of my favourite links below.

http://www.cairngormdocs.org/cairngormDiagram/index.html

http://www.onjava.com/pub/a/onjava/2003/02/26/flash_remoting.html?CMP=AFC-ak_article&ATT=Flash+Remoting+for+J2EE+Developers

http://sujitreddyg.wordpress.com/2008/01/14/invoking-java-methods-from-adobe-flex/

http://livedocs.adobe.com/blazeds/1/blazeds_devguide/blazeds_devguide.pdf

http://sujitreddyg.wordpress.com/2008/05/16/session-data-management-in-flex-remoting/

http://www.brucephillips.name/blog/index.cfm/2008/6/23/Using-BlazeDS-to-Send-UserDefined-Data-Types-Data-Tranfer-Objects-from-Java-to-Flex

http://renaun.com/blog/2006/07/04/55/

http://www.adobe.com/devnet/flex/articles/cairngorm_pt4_05.html

http://examples.adobe.com/flex3/componentexplorer/explorer.html

Experience with chrome

Posted in reviews by vengatc on September 30, 2008

Like most of the people im also an adrenet fan of google and its tools.When chrom was released i tried it the first day.

My first impression.

1. Great screen space.

2. Super look and feel.

3. Elimination of not frequently used icons from occupying the space for the web page.

I will rate it top in the ergonomics compared to other browsers.

Performance.

1. It sucks in CPU usage. Im disappointed to see the browser take the entire CPU resource. How could Google program the browser this way???  Cant it manage the CPU resource, the most important one before releasing?? We know most of the time firefox hog the CPU and same does the IE. When google released  Chrom is  should have taken care of cpu overload issue with its programming.

Im back to firefox. And  i wish chrom resolve its cpu hog issue in the next release for me to adopt it back in my pc.

I can resolve the chrom hog issue for you google…. pay me for that 🙂

Agile development process with SCRUM technique

Posted in process by vengatc on September 30, 2008

Agile development process

Principles

1. Indiviuals and interactions over process and tools.

2. Working software over comprehensive documents.

3. Customer collobration over contract negotiation.

4. Responding to change over Following a plan.

Process

                        Agile is a customized RUP (IECT) methology but with the above principles to be the guidlines. Scrum is the practicle implementation technique for Agile methology.

Scrum involves.

1. Project split into multiple sprints [Time frame directed]

2. Project has baglog items.

3. Each sprint has a chosen highpriorty baglog items to deliver.

4. Customers are alowed to updated the baglog items.

5. Custoemr contract delivery based pay model. not deliver the product as a hole.

6. Sprint planning meeting with manager and stakeholders(Chickens) and developers(Pigs) deciding the items in teh baglog tha tis goign to be developed in the sprint.

7. After spring palning meeting work units are  formed by developers based on the baglogs.

8. Daily there is a scrum meeting where each developer says what he has done.

9. New work unit generation is accepted and the new unit may be commited or left uncommited.

10. Each work unit is  2 hours of work item

 

Burn down chart

Burn down chart

 

 

11. Each sprint is give for test for testing (Test driven development ).

 

 

 

 

Reference

http://www.itwales.com/998612.htm

http://www.objectmentor.com/resources/articles/agileProcess.pdf

ApacheDS and Windows

Posted in LDAP, windows by vengatc on August 22, 2008

1. Download apache DS from http://directory.apache.org/apacheds/1.0/

2. Creating a partition in ApacheDS doesnt work well. as shown in http://directory.apache.org/apacheds/1.0/14-basic-configuration-tasks.html#1.4.Basicconfigurationtasks-Addingyourownpartitionresp.suffix

3. So edit example entry with the entry you want.

4. Use JXplorer to create organizations.

Flex and JAVA

Posted in Flex, java by vengatc on August 22, 2008

Flex and POJO

Posted in Uncategorized by vengatc on August 22, 2008

Flex can work with POJO with Life cycle data service and BladeDS product offerings of Adobe.

BladeDS server for tomcat is available at

Jtapi

Posted in java, telephony by vengatc on August 22, 2008

Heads on Ruby and rails

Posted in Uncategorized by vengatc on August 22, 2008

Installing JAVA in fedora

Posted in java, linux by vengatc on August 22, 2008

By default, Fedora Core 6 systems come with an old Java software installed, so you need to install a newer version of Java Runtime Environment to enjoy all the Java applications out there. In this quick guide, I will teach you how to update/install your Java Environment.

Let’s begin by downloading the latest version of JRE (Java Runtime Environment) from here. Just click on the Download link where it says Java Runtime Environment (JRE) 5.0 Update, then you’ll need to accept the license and download the Linux self-extracting file.

WARNING: Please remember to always replace the xx from the jre-1_5_0_xx-linux-i586.bin file with the latest version. At the moment of this guide’s writing, the latest version was 09, so the file should look like this: jre-1_5_0_09-linux-i586.bin

After you have finished downloading the file, you need to move it into the /opt folder. Open a console and type:

mv jre-1_5_0_xx-linux-i586.bin /opt

Now, you will need to make this file executable so you can extract it. Follow the commands below:

cd /opt – so you can go into the /opt directory
chmod +x jre-1_5_0_xx-linux-i586.bin

And now, let’s run the executable file with the following command:

./jre-1_5_0_xx-linux-i586.bin

You’ll be prompted with the License Agreement, hit space until you are asked if you agree or not. Type Yes and the extraction process will begin. After the extraction process is finished, just remove the binary file with the following command:

rm -rf jre-1_5_0_xx-linux-i586.bin

Now, let’s put the Java plugin into your browser’s plugin folder. Konqueror, Firefox and Mozilla browsers will all look into the same folder, for plugins. So type the following command:

ln -s /opt/jre1.5.0_xx/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so

Well, now you need to make the Java executable available for the whole system, so you can run all the Java applications you encounter. Create the following file with your preferred text editor:

kwrite /etc/profile.d/java.sh

Now paste the following options into the file, remember to enter a carriage return after these lines, then save it. Remember to replace the xx with the latest version you have downloaded:

export J2RE_HOME=/opt/jre1.5.0_xx
export PATH=$J2RE_HOME/bin:$PATH

Now, type the following command to make that file available:

source /etc/profile.d/java.sh

Then type this command to see if the path is correct:

which java

You will see something like this: /opt/jre1.5.0_09/bin/java

Then type these commands:

/usr/sbin/alternatives –install /usr/bin/java java /opt/jre1.5.0_xx/bin/java 2
/usr/sbin/alternatives –config java

After you have entered the last command, you’ll be asked to choose which Java software you want for your system. Just press 2 key and hit enter.

And finally, just type this command to see if everything looks good and your system has a new Java Environment:

/usr/sbin/alternatives –display java

And you can also type this command to see the version of your Java Runtime Environment:

java -version

Mine looks like this:

java version “1.5.0_09”
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01)
Java HotSpot(TM) Client VM (build 1.5.0_09-b01, mixed mode, sharing)

You should now be able to run most of the Java applications out there, with the commands like:

java -jar application.jar

or

javaws application.jnlp

Enjoy!