Maven Runs out of Memory

Maven 1.0 has some problems with memory leaks. Most of the time these aren’t issues, but if you are trying to compile a multiproject you might run into problems. By default Maven tells java to let it have up to 256MB of ram. If you need to increase this you’ll need to open the maven.bat (windows) or maven.sh (unix) file and change the way that java is called. Somewhere around line 118 (on the .bat file)you should see the following:

if "%MAVEN_OPTS%"=="" SET MAVEN_OPTS="-Xmx256m"

Change the line so it reads:

if "%MAVEN_OPTS%"=="" SET MAVEN_OPTS="-Xmx1000m"

This will give Maven 1GB of memory to work with. While this doesn’t really solve the problem of the memory leak, it may give you enough space to keep the problem from crashing Maven.

You can also set MAVEN_OPTS by setting it up as a variable in your environment. If you do this the environment will override anything you set in the .bat or .sh file.

Software Design

One of the major purposes of software design is to avoid making mistakes. You design your software so you don’t get halfway into the project and say “Oh yeah I didn’t think about that” and have to start over again or continue with a weak foundation. Unfortunatley don’t know exatly what type of mistakes you are likely to make until after you start coding. Since you don’t really know what the real problems are until after you encounter them, you are left with two options. First you can create your design to eliminate problems that you’ve experienced in other project. Second you can build a prototype to get an idea of what will be a problem then design and code the final system.

Trying to plan ahead and eliminate problems before they occur sounds like a great idea, but it often increases the complexity of the project. This isn’t a bad thing if the increased complexity solves real problems, but since you are trying to solve “imagined” problems before they actually occur, some won’t turn out to be problems at all. This means that that software is more complex than necessary.

Hosting Changes

I have been hosting this site at www.redwoodvirtual.com. The offer some inexpensive virtual private servers and most of the time everything runs well. Unfortunately their server decided that I had gone over my 40 GB of monthly bandwidth and throttled everything down to a very low level. Pages were taking 30 to 120 seconds to load. Redwood’s support is only through email and they seem to check it every 48 hours. The biggest problem is the fact that if they ask you for information in resolving the problem, you’ll have to wait another 48 hours for them to read your reply, so conversations look something like this:

Me: Something is wrong with the bandwidth. Can you please fix it? If you need info from me to fix it, please call me so we don’t have to wait several days for each exchange.
[Wait 48 hours]
Redwood (via email): Hmm… it looks like your bandwidth is being throttled. Do you think you went over 40 Gigs?
Me: No. According to my logs I’ve used only about 12 GB this month. I’m willing to pay more to get things up and running immediately because I can’t afford to have my site down. Can you turn it back on right away?
[Still Waiting for a response]

I went ahead and signed up for an account with www.hostforweb.com. I’m on a shared server, but I figure there is safety in numbers. If their server goes down and I’m not around to tell them, someone else will say something. The also offer ssh access which makes it a lot easier to test scripts, move files around, etc. I’m looking at their virtual private server plans, but I think the shared server may meet all of my needs.

I think my ideal setup would be to use a company like Redwood Virtual to run nightly jobs that upload their results to a shared server site. That way I’d get the flexibility of having root access, but with better reliability for my public pages.

Tiger 10.4.1 for Intel X86 on BitTorrent

It is probably too early to tell if it is true, but there are some rumors going around that there is a bit torrent of a version of OS X that runs on regular intel hardware. There is even an image of a Compaq running the operating system. Some people have the opinion that this is a clever ploy by Apple to create a lot of publicity. Personally I doubt if that’s the case. It seems unlikely that they would be trying to get publicity for something that you won’t be able to buy for another 12 months or so. There is quite a bit of discussion going on about whether or not the download is real. Most of the Slashdot crowd is calling it a fake, but several posters to www.thePirateBay.org claim that the file called Mac.OS.X.Tiger.X86.READNFO-XISO is the real thing.

PirateBay is showing only one download of the operating system so far and one user is claiming to have it installed. I must admit that when I saw the rumors originally, the thought of posting an iso of Linux labeled as Tiger for Intel did cross my mind. The file being shared may be the result of someone else having the same idea.

The best comment on Slashdot was this:

I think the question all mac users are asking is, will this run on Virtual PC???

Setting up SVN over SSH

If you want to access svn over ssh, you need to make sure that everyone has the correct file permissions. In the following steps we create a directory named svn-repo and change it’s ownership to a group called svn. Then we create the repository and change the security to allow access by people in the svn group.

mkdir svn-repo
chgrp -R svn svn-repo
cd svn-repo
svnadmin create
chmod -R 770 .
chmod g+s db

On Unix and Linux clients using svn over ssh is very straight forward. Windows is a little more tricky. You’ll need to download plink.exe (one of the downloads with putty.exe) and the subversion command line client. Install them and then copy all the files to C:\WINDOWS\SYSTEM32. You now need to make sure that SVN knows to run plink for ssh. Do this by issuing:
set SVN_SSH=plink.exe -l [username] -pw [password]
This will tell SVN how to log in using ssh. (You’ll probably want to add this to your profile so you don’t have to run it each time. You may also need to logon once using plink.exe to get the keys to work. To do this just connect to the SVN server using ssh (plink [email protected]).

Once this is set you should be able to use svn normally.