|
Abbey Workshop |
||||||||||
My attempts to replace the software that runs this site are moving forward. In fact, as of today, I can generate a home page just like the one you are currently looking at. Woo hoo!
But I am still a few weeks away from swapping it out. I still need to generate the atom and RSS2 feeds. I have the atom stuff working, but not properly tested. Haven't started on the rss2 stuff yet.
The application is a combination of scripting software and XSLT. Right now I'm using mainly Perl to create the XML indexes necessary to generate the main page and feeds. I started out using Ruby, but switched back to Perl as I have found learning Ruby to be a little slower going than I planned originally. So I'm going to create everything in Perl first. Then go back and create a Ruby version. Ruby is cool, but I know Perl much better and I want to get this done sooner rather than later.
Since my team at work is using Perl to do some quick and dirty prototyping I have been looking around for some good Perl XML parsers. Stuff that is simple and easy to use, not just a SAX or DOM parser. Because, well…, I’m lazy and the less feces I have to deal with to get the job done, the better.
Anyway, I had looked at XML::Simple but could not find any good introductions or tutorials. (Hint for you geeks out there: The output from Data::Dumper though interesting, is not by itself an explanation or an example of how to use the library in practice.) Finally I ran across this excellent article and thought I should share: Parsing XML documents with Perl’s XML::Simple.
I ran across a little tip tonight I thought I should share. Trying to perform a large XSLT tranform with Ant kept giving me the following error: Out of memory. Increase Heap Size.
This is a Java error indicating that the virtual machine is out of memory. So now I know what the problem is, what next? If I was launching from a command line changing the heap size is not that tough. Just look up the options for java and set a new value, but I’m using Ant. Looking at the Ant shell script or batch file was no help.
Well a bit of Googling turned up that Ant looks for an environment variable called ANT_OPTS which is use to set Java parameters. Just set the environment variable and off you go. So I added the following to increase the heap size:
export ANT_OPTS=-Xmx256m
That sets the maximum heap size to 256 Megabytes. It solved my problem as the XSLT transform topped out at about 220Meg. So if you ever need to increase the size of the Ant JVM, now you know how.
Copyright © Abbey Workshop 2005