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.

Advertisements
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