I've been trying to debug an issue in our QA environment for the last few weeks and also to do a presentation next Wednesday to my JUG.
I found a free tool from dev.java.net called Visual VM https://visualvm.dev.java.net/
I found VisualVm to be very useful and has many features that go way beyond jconsole and has most of the features available in a commercial product. I especially like the threads view. I wish I could do remote profiling with VisualVm but I believe that feature is probably not too far in the future. The platform is extensible via a plug-in interface.
This other slide set has some good tuning info as well http://www.slideshare.net/Byungwook/jvm-performance-tunning-1154189
I just found this SlideShare from a JavaOne conference.
This should be a good reference for my 6/17 RJUG Presentation, although there's more to a presentation than just slides, some of them don't go into much detail.
Friday, June 12, 2009
Tuesday, June 9, 2009
Setting up a New Subversion Repository Server
Abstract
This will walk through the steps of creating and sharing a subversion repository. We're working on a virtual Windows XP instance because its almost always available and gets backed up regularly. I chose VisualSvn Server because it is almost zero configuration and it works nicely on XP, no mess no fuss. I also make use of TortoiseSVN for the task of initializing the repository, checking in and out so install TortoiseSVN right after installing VisualSvn Server. All Language Developers: No fear, VisualSvn Server is still a subversion server, no need to get Visual Studio, works with Java, *** its just a great Windows distribution that is easy to setup.
Background
We have a new development sub-project (finally) for which we can use Subversion to share/store the code base. My main project is called MASS and the new project will load natural gas production measurements (readings) from our new hand-held units via a web service.
1. Log into the Remote XP Server VM
2. Download and Install VisualSvn Server from http://www.visualsvn.com/server/. I found this article http://www.west-wind.com/presentations/subversion/ useful in making the decisions getting started. I chose SSL and Windows Authentication.
3. Configure the Repository
Use the SvnServer Admin tool available under "myComputer" > "Manage" > "Services" and "Applications".
4. Enable Repository Access
Right-click on "Repositories", select "Properties". This brings up a window with one tab labeled Security. Select the "Add" button to add user access. Select the "Locations..." button and select your active directory server as the authentication source, type the userId of a user and select "Check Names..." This should resolve the userId to a windows Domain user. By default this will give all the users entered here read/write access to any of the repositories created on this server. That works for me since our project owns the XP VM.
5. Create a Repository
Right-click on "Repositories" in the hierarchy and select "Create New Repository..." Name it what you like and select the checkbox "Create default structure (trunk, branches and tags)". After you select "OK", the status on the main admin screen should read "Total 1 repositories".
6. Right click on the new repository folder named "trunk" and select "New" and "Folder...". Name it "src" or something you are comfortable with.
7. Switch to your desktop and Create the Project root Folders
cd c:\
mkdir GAS
cd GAS
mkdir MASS
cd MASS
7. Check out the new folder from the repository
Open the file system explorer and navigate to the new project folder (MASS in my example). Right-click on the folder and select "TortoiseSVN", "Repo-browser", paste the URL of your new VisualSVN Server instance admin client, and select the newly created folder from the repository and select "Check out". This will be the basis for you to populate the rest of the repository with your existing code.
This will walk through the steps of creating and sharing a subversion repository. We're working on a virtual Windows XP instance because its almost always available and gets backed up regularly. I chose VisualSvn Server because it is almost zero configuration and it works nicely on XP, no mess no fuss. I also make use of TortoiseSVN for the task of initializing the repository, checking in and out so install TortoiseSVN right after installing VisualSvn Server. All Language Developers: No fear, VisualSvn Server is still a subversion server, no need to get Visual Studio, works with Java, *** its just a great Windows distribution that is easy to setup.
Background
We have a new development sub-project (finally) for which we can use Subversion to share/store the code base. My main project is called MASS and the new project will load natural gas production measurements (readings) from our new hand-held units via a web service.
1. Log into the Remote XP Server VM
2. Download and Install VisualSvn Server from http://www.visualsvn.com/server/. I found this article http://www.west-wind.com/presentations/subversion/ useful in making the decisions getting started. I chose SSL and Windows Authentication.
3. Configure the Repository
Use the SvnServer Admin tool available under "myComputer" > "Manage" > "Services" and "Applications".
4. Enable Repository Access
Right-click on "Repositories", select "Properties". This brings up a window with one tab labeled Security. Select the "Add" button to add user access. Select the "Locations..." button and select your active directory server as the authentication source, type the userId of a user and select "Check Names..." This should resolve the userId to a windows Domain user. By default this will give all the users entered here read/write access to any of the repositories created on this server. That works for me since our project owns the XP VM.
5. Create a Repository
Right-click on "Repositories" in the hierarchy and select "Create New Repository..." Name it what you like and select the checkbox "Create default structure (trunk, branches and tags)". After you select "OK", the status on the main admin screen should read "Total 1 repositories".
6. Right click on the new repository folder named "trunk" and select "New" and "Folder...". Name it "src" or something you are comfortable with.
7. Switch to your desktop and Create the Project root Folders
cd c:\
mkdir GAS
cd GAS
mkdir MASS
cd MASS
7. Check out the new folder from the repository
Open the file system explorer and navigate to the new project folder (MASS in my example). Right-click on the folder and select "TortoiseSVN", "Repo-browser", paste the URL of your new VisualSVN Server instance admin client, and select the newly created folder from the repository and select "Check out". This will be the basis for you to populate the rest of the repository with your existing code.
Friday, June 5, 2009
JVM Profiling and Optimization
Caveat: I'm really new at JVM profiling and memory leak troubleshooting so I'm making certain assumptions and taking certain steps to feel my way through the process.
TOOLS
I'm using a combination of tools and OS logging to get feedback from the JVM.
1. YourKit for Java (http://www.yourkit.com/)
YourKit is very easy to install against a WebLogic JVM and monitor via a remote PC desktop. It is free for developers contributing to non-commercial Open Source projects, with an established and active community and has a reasonable academic license fee. YourKit has a script that will generate the modifications needed to be made to the host JVM. This makes installation much easier.
2. Sun's VisualVM I am evaluating this as I write. I see much of the features available in YourKit here, however YourKit has really easy setup and nicer charting features. VisualVm seems to beat JConsole pretty handily. To use VisualVM to retrieve data from a remote application, the jstatd utility needs to be running on the remote JVM. All the tools need some kind of modification to either the remote server or remote JVM startup parameters.
Some of the blogs about VisualVm have yielded a few really handy commands, such as jps (find the PID of the Java Processes) and jstat (get status of JVM at PID). I also see mention of something from Sun called visualgc which is also available from Sun's dev.java.net. Some of these appear possibly to be orphan projects.
3. Java's JConsole (http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html)
Jconsole provides basic information about a profiled JVM (not as much and not presented as nicely as YourKit, but it is free) and requires more setup (see my post "Connecting to a Remote JConsole Session" for setup.
4. A series of custom logging scripts that essentially scrape Unix top or other unix admin commands for pulling out information about the running processes and logging that information to a format that can be easily put into Excel for charting and analysis.
Links:
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
http://www.slideshare.net/kensipe/debugging-your-production-jvm
https://visualvm.dev.java.net/
TOOLS
I'm using a combination of tools and OS logging to get feedback from the JVM.
1. YourKit for Java (http://www.yourkit.com/)
YourKit is very easy to install against a WebLogic JVM and monitor via a remote PC desktop. It is free for developers contributing to non-commercial Open Source projects, with an established and active community and has a reasonable academic license fee. YourKit has a script that will generate the modifications needed to be made to the host JVM. This makes installation much easier.
2. Sun's VisualVM I am evaluating this as I write. I see much of the features available in YourKit here, however YourKit has really easy setup and nicer charting features. VisualVm seems to beat JConsole pretty handily. To use VisualVM to retrieve data from a remote application, the jstatd utility needs to be running on the remote JVM. All the tools need some kind of modification to either the remote server or remote JVM startup parameters.
Some of the blogs about VisualVm have yielded a few really handy commands, such as jps (find the PID of the Java Processes) and jstat (get status of JVM at PID). I also see mention of something from Sun called visualgc which is also available from Sun's dev.java.net. Some of these appear possibly to be orphan projects.
3. Java's JConsole (http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html)
Jconsole provides basic information about a profiled JVM (not as much and not presented as nicely as YourKit, but it is free) and requires more setup (see my post "Connecting to a Remote JConsole Session" for setup.
4. A series of custom logging scripts that essentially scrape Unix top or other unix admin commands for pulling out information about the running processes and logging that information to a format that can be easily put into Excel for charting and analysis.
Links:
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
http://www.slideshare.net/kensipe/debugging-your-production-jvm
https://visualvm.dev.java.net/
Enabling JMX on a JVM
This is necessary for many of the profiling options, such as allowing a remote JConsole session to connect to a JVM.
I've been profiling my QA WebLogic application because it's been really misbehaving the last two weeks. Sun's free swing app, jconsole, gives a bunch of insight into performance metrics such as memory, garbage collection and object counts.
REFERENCES
SEE ALSO
I've been profiling my QA WebLogic application because it's been really misbehaving the last two weeks. Sun's free swing app, jconsole, gives a bunch of insight into performance metrics such as memory, garbage collection and object counts.
- Enable your JVM to use JConsole
The jconsole app is enabled via command line parameters that activate at startup. On weblogic you modify the file setDomainEnv.sh in the bin directory of your WL 'domain'. Add the following (Solaris/Unix):
# Allow JConsole to view this JVM
JC_JMX_ENAB="-Dcom.sun.management.jmxremote=true"
# Allow remote access to JConsole at this port
JC_JMX_PORT="-Dcom.sun.management.jmxremote.port=5097"
# Don't require login
JC_JMX_AUTH="-Dcom.sun.management.jmxremote.authenticate=false"
# Don't require SSL
JC_JMX_SSL="-Dcom.sun.management.jmxremote.ssl=false "
JAVA_OPTIONS="${JAVA_OPTIONS} ${JC_JMX_ENAB} ${JC_JMX_PORT} ${JC_JMX_AUTH} ${JC_JMX_SSL}"
export JAVA_OPTIONS - Restart the WL Server instance or JVM
- Start a command line JConsole session on your desktop
Do this by executing jconsole.exe from the bin directory of your JSDK installation. - Connect to your remote server at the specified JMX port
Select the 'Remote Process' radio button and enter the host server name and using the port (5097 in this example) in the form [hostname]:[port].
REFERENCES
- http://www.javapassion.com/handsonlabs/jconsole/index.html#Configure_a_simple_app
- http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html
- http://java.sun.com/javase/6/docs/technotes/tools/share/jconsole.html
SEE ALSO
XP Connecting to a Solaris Server via X11 XWindows
I'm working out the details of how to view the JConsole profiling information from my Windows XP desktop.
I began with the misconception, that unless one is running jconsole locally (e.g. on the same server) as the one the JVM is running, then the amount of jconsole information you can see is limited. From the Java documentation at Sun, you are led to believe that remote sessions are unable to access certain tabs.
Having busted that, I'm now left with some valuable info that I know will be useful later, so here it is.
HOW TO GET AN XWindows connection to a Solaris Server.
One requirement is to have an XWindows session running on XP.
The other is to enable X11 over SSH on the Solaris server.
I used Cygwin/X on the desktop. It's great and there's plenty of easy documentation on cygwin's web site to get you going here <http://www.javapassion.com/handsonlabs/jconsole/index.html#Configure_a_simple_app>.
On Solaris modify the file /etc/ssh/sshd_config. Enable X11 tunneling by finding the section labeled "X11 tunneling" and make it match the following:
I began with the misconception, that unless one is running jconsole locally (e.g. on the same server) as the one the JVM is running, then the amount of jconsole information you can see is limited. From the Java documentation at Sun, you are led to believe that remote sessions are unable to access certain tabs.
Having busted that, I'm now left with some valuable info that I know will be useful later, so here it is.
HOW TO GET AN XWindows connection to a Solaris Server.
One requirement is to have an XWindows session running on XP.
The other is to enable X11 over SSH on the Solaris server.
I used Cygwin/X on the desktop. It's great and there's plenty of easy documentation on cygwin's web site to get you going here <http://www.javapassion.com/handsonlabs/jconsole/index.html#Configure_a_simple_app>.
On Solaris modify the file /etc/ssh/sshd_config. Enable X11 tunneling by finding the section labeled "X11 tunneling" and make it match the following:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Finding the PID (Process Id) of a Windows XP Process
Open up the Windows Task Manager (Either press Ctrl+Alt+Del and select "Task Manger", or issue the command "taskmgr" from the command line).
Click on the “Processes” tab.
Select the “View" menu item and choose "Select Columns...”.
Check the "PID (Process Identifier)" checkbox and click the "OK" button
The process list will now show the PID of each running process.
There are a number of other properties you might like to show on the process list.
This is a hidden gem.
Click on the “Processes” tab.
Select the “View" menu item and choose "Select Columns...”.
Check the "PID (Process Identifier)" checkbox and click the "OK" button
The process list will now show the PID of each running process.
There are a number of other properties you might like to show on the process list.
This is a hidden gem.
Tuesday, May 5, 2009
Productivity Tools
I've developed a list of my favorite productivity tools for a presentation to my local beCamp.
I'm a Java developer but if you are not a programmer that doesn't mean these tools aren't for you. I do a variety of tasks and I want these tools to be available to me on whatever system I'm using. Feel free to comment and recommend others.
Top Favorites
Network
Development
Desktop
BeyondCompare www.scootersoftware.com
My number one all-time favorite & must-have.
Overview
Favorite Features
Platforms:
Wish List:
Beyond Compare Example of a folder comparison.

Beyond Compare Example of a file comparison

Hypersnap www.hyperionics.com
Overview
Favorite Features
Platform: Windows
Cost: $35
See also HyperCam which captures action and sound from a windows desktop and saves to AVI format.
FinePrint www.fineprint.com
Overview
Favorite Features
Platform: Windows
Cost: $49.95
Synergy synergy2.sourceforge.net
Overview
Favorite Features
Platforms: Windows, Mac, Unix
Cost: $0.00, but a project worth supporting
Latest release April 2, 2006
Requires TCP/IP
Wiki on a Stick stickwiki.sourceforge.net
Overview
Favorite Features
Platforms: Windows, Mac, Unix
Cost: $0.00, but a project worth supporting
BareGrep baremetalsoft.com
Overview
Favorite Features
Platforms: Windows only
Wish List:
Cost: $0.00, there is a $25 'pro' version with additional features
BareTail baremetalsoft.com
Overview
Favorite Features
Platforms: Windows
Wish List:
Cost: $0.00, there is a $25 'pro' version with additional features
next
I'm a Java developer but if you are not a programmer that doesn't mean these tools aren't for you. I do a variety of tasks and I want these tools to be available to me on whatever system I'm using. Feel free to comment and recommend others.
Top Favorites
- Beyond Compare (file and folder comparison, desktop, network, server, ...it does it all)
- Hypersnap (screen capture and editing)
- FinePrint (printer output control)
- Wiki on a Stick (portable wiki)
- BareGrep
- BareTail
Network
- Secure CRT 32 (Telnet, SSH, rlogin)
- Filezilla (FTP)
- Putty (Telnet, SSH, rlogin)
- CurrPorts (show open ports)
- SmartSniff (packet sniffer)
- SocketSniff (socket sniffer)
Development
- Oracle SQL Developer (oracle database client)
- Toad (oracle database client)
- Textpad (text editor)
- Notepad++ (text editor)
Desktop
- Synergy (software KVM)
- Second Copy (backup)
- RocketDock (application launcher)
- Launchy (application launcher)
BeyondCompare www.scootersoftware.com
My number one all-time favorite & must-have.
Overview
- Compare files & folders between desktop or FTP hosts.
Favorite Features
- Visualize and merge changes in files or folders.
- Synchronize folders and file systems such as Test & QA servers (via FTP & its fast), thumb drive contents.
- Compare & navigate Zip and Jar file contents
- Windows File System Explorer integration
Platforms:
- Windows; Red Hat Enterprise Linux 4, 5; Fedora 4 - 10; openSUSE 10.3, 11; Ubuntu 6.06 - 8.10
Wish List:
- Mac version (please let me know if you hear of anything like this for Mac)
- $30 (Standard), $50 (Pro) --well worth the cost!.
It pays for itself by quickly showing me what files are different
Beyond Compare Example of a folder comparison.

Note: This is a comparison of a folder on my local Windows file system with a folder on a Unix server. This is very handy to compare configuration files between Test and QA systems.
Beyond Compare Example of a file comparison

Note: Again, this is showing me the contents of a file on my local Windows system versus a file on a Unix server.
Hypersnap www.hyperionics.com
Overview
- Windows screen capture and image manipulation
Favorite Features
- Scrolling window capture handy for capturing from browser
- Vertical and horizontal trim
- Text snap
- Image resizing, color correction & other standard image manip. features
Platform: Windows
Cost: $35
Another of my favorite and most-used applicaitons.
See also HyperCam which captures action and sound from a windows desktop and saves to AVI format.
FinePrint www.fineprint.com
Overview
- An intermediary virtual printer that lets you preview and manage what gets printed and how, then lets you send it on to the printer of your choice.
Favorite Features
- See it before it goes to the printer (save paper)
- Print two, four or eight per page (save paper)
- Convert page size (i.e. from legal to letter)
- Delete unwanted pages
- Add borders, gutters, headers, watermarks, footers
- Combine multiple print jobs into one
- Easy to bypass if desired, easy to select different printers
Platform: Windows
Cost: $49.95
Another top favorite!Very stable, low memory footprint
Synergy synergy2.sourceforge.net
Overview
- Share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware.
- Intended for users with multiple computers on their desk since each system uses its own monitor(s)..
Favorite Features
- Cut and paste between computers
- Works w/ multi-monitor configurations
Platforms: Windows, Mac, Unix
Cost: $0.00, but a project worth supporting
Latest release April 2, 2006
Requires TCP/IP
Wiki on a Stick stickwiki.sourceforge.net
Overview
- A wiki that lives in one small self-modifying XHTML file
Favorite Features
- Organize your favorite sites, project URLs, etc
- Easy to edit
- Quick and dirty web site mock up
- Organize your kids/wife's/parents internet favorites
Platforms: Windows, Mac, Unix
Cost: $0.00, but a project worth supporting
BareGrep baremetalsoft.com
Overview
- Search for files on a windows file system
- Regular expressions text search
- Wildcard and regular expressions file search
- Shows search results in context
Favorite Features
- Single small executable
- High performance
Platforms: Windows only
Wish List:
- Connect and search via FTP, as in Beyond Compare
Cost: $0.00, there is a $25 'pro' version with additional features
BareTail baremetalsoft.com
Overview
- File / log monitoring tool
- Follow tail mode (like tail -f on Unix)
Favorite Features
- Configurable text highlighting
- Single small executable
- High-performance search algorithm
- Save, name and manage text search patterns
Platforms: Windows
Wish List:
- Connect and tail via FTP connection as in Beyond Compare
Cost: $0.00, there is a $25 'pro' version with additional features
next
Subscribe to:
Posts (Atom)