simple svn project repository migration steps

Tuesday, March 29, 2011

Migrate repositories using the eclipse subclipse plugin.
Note this method will not bring revision history into the new repository, so assumes you will still have ongoing access to the old respository. This technique is useful if the history isn't that rich, and you want a quick switch over, or if you don't directly manage the repositories, so svnadmin commands aren't available (like our case, we use a hosted JIRA solution).

Steps:

  1. Create the new project top-level folder in the new repository. Eg: /NEWREPO/projectA/trunk. Using 'new remote folder' in SVN repositories view is the easiest.
  2. Open the existing project in eclipse
  3. Choose team> switch to another branch/tag/revision.
  4. Choose intended top-level project folder (eg /NEWREPO/projectA/trunk). Note this folder name doesn't have to become the eclipse project name
  5. team> revert the project to remove local changes
  6. team> merge (Install into eclipse the fantastic CollabNet Merge client, if haven't already)
  7. Untick best-practices check and choose 'Merge range of revisions', then Next
  8. Select, then under Root, browse to the exisiting project folder (original repo) (eg /OLDREPO/projectA/trunk)
  9. Commit the project

Linux swap space - real usage

Wednesday, January 19, 2011

Using top, ps aux, etc etc gives all kinds of memory usage with lots of blog posts and forum questions explaining how difficult they are to understand, and how typically aren't actually that useful.

As of kernel 2.6.14, smaps has been introduced which means each process reports its own memory usage breakdown.

smaps detail for a process can be seen by:

sudo cat /proc/PID/smaps
where PID is the process ID of the process you're interested in. Note you won't see any content if not the process owner or root.

So, use top, find the big memory hoggers first. Then look at the smaps file for the swap usage. You can use, for example:
sudo grep Swap /proc/30888/smaps | cut -d" " -f 10-20 | grep -v ' 0 kB'
where 30888 is an eg PID.

For more advanced smaps analysis, try the smaps.pl tool. Not sure at this stage, though, whether that tool gives separate swap values.

In Debian at time of this post, the pmap tool has been patched to use smaps, which may then offer swap values in its output.