Tuesday, September 27, 2005

CVS Tricks

Objective: You want to merge from a branch Branch_Q into branch Branch_P

cvs -q update -j Branch_P -j Branch_Q

Objective: Create a branch Branch_P at the location where a branch Branch_M has been tagged.

cvs rtag -r Branch_M Branch_P directory

Let's say you want to try something out but still be able to easily come back to the current version of the code if your experiment doesn't work. However, you want to keep the experiment around, or you want to be able to edit the main branch at the same time.

1. Commit current code.

> cvs commit

2. Tag the current code

> cvs tag before_new_image_code

3. Create a new branch

> cvs tag -b new_image_code

4. Move to new branch

> cvs update -r new_image_code

Now any changes which are made will be commited to the new branch. To switch back and forth between the branch and the trunk use the following commands.

* Move back to trunk/main version of code.

cvs update -A

* Move back to specified branch

cvs update -r new_image_code

Make sure to do a commit before switching to another branch. Update will overwrite your current working files with the latest version from the branch you specify, so all changes will be lost unless they have been committed.

Let's say your experiment worked and you want to merge the branches.

1. Move to main branch

> cvs update -A

2. See what the differences are between the branch we want to merge with and the main branch.

> cvs diff -r new_image_code

3. Merge the branch into the main branch.

> cvs update -j new_image_code

You will be told about any conflicts during the merge, and you won't be allowed to commit the files until those conflicts are dealt with.

CVS Notes

Sunday, September 25, 2005

Good Web Services Resources

Web Services can be key when working towards SOA or light coupled systems. A good resource on web services is the MSDN library on .Net web services. It contains good stuff for people who are trying to understand the ins and outs of web services.
.Net Web Services
SOAP Headers

SAAJ: No strings attached

Wednesday, September 21, 2005

JVM Heap Tuning

I am going to just compile a list of urls that refer to JVM tuning.

  1. Java Forums - Large JVM heap sizes under windows xp?

  2. Change JDK DLL rebasing on win32 to allow larger maximum heap

  3. Look at the following article that talks on JVM Stack/Heap based allocation plus threadlocal allocation etc in this nice article:

  4. JVM Performance

Sunday, September 18, 2005

Understanding memory management with Caching Objects in Memory

This is a common problem. How much should we cache in memory? Will we run into Out Of Memory Errors?

I suggest you have a look at the SoftReference class in Java. It is an excellent construct that can save you this OOM headache.


  1. Implementing a SoftReference-based HashMap

  2. SoftReference, WeakReference, and WeakHashMap in Java

  3. Garbage Collection

  4. Java: Performance Tuning and Memory Management