Thursday, January 21, 2010

Java Problems

Steve decided to have his own distribution of Java on MacOSX (Hence Sun does not provide any MacOSX specific JVM). It is actually located in /System/Library/Frameworks/JavaVM.framework/Versions/ and most of the files there are just links to the latest JDK. Which is not a big deal. However, with Eclispe and Netbeans I had run into some issues which I couldn't figure out. It would complain about some arb xalan problem when trying to do many things in Eclispe (including saving the workspace on exit). Netbeans was much more sneaky. It simply kept on installling plugins into oblivion. That's right - endless loop!
I got fed up and used Pacifist to extract 1.5 JDK from the archive I downloaded from Apple's site. The bonus is I have 2 versions of SDK now instead of 1. Anyways, by editing Eclipse and Netbeans startup scripts I managed to get them going with 1.5.
Today I tried to install IzPack, which came as a jar file and it kept on giving me java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion(Ljava/lang/String;)V no matter what I did. I tried manually running it with 1.5 to no avail. Until I discovered a bunch of jars in ~/Library/Java/Extensions/ among which was the infamous xalan.jar dated 2003 for some reason. I zapped those and wow! all is working...

Sunday, January 10, 2010

I have been doing a lot of dev lately and have a few IDEs and such open together with the regular mail and web browsers. I have 2GB of very fast RAM in my notebook and I started experiencing a lot of memory swapping. So I had a look at the process list and noticed (apart from humongous memory consumption by Netbeans and Eclipse) that Chrome was 2nd worst and also KAV was making quite an impression.

Anyways, not much can be done about KAV except disabling it, but I decided to compare Chrome - FF - Safari and Opera in terms of memory usage (nothing else). Well, as you may know Chrome runs each tab as a separate process while others just run them as separate threads. For my tests I launched one browser at a time and opened 3 tabs: www.news24.com, www.google.co.za and www.imdb.com

Below are the results:

Chrome (beta for Mac) 112MB
Firefox (3.0.15 for Mac) 72MB
Firefox (3.5.7 for Mac) 74MB
Minefield (3.7alfa-pre1 64bit for Mac) 87MB
Safari (4 for Mac - 64bit) 83MB
Opera (10.10 for Mac) 72MB

This is only with 3 tabs open. What is Minefield you may ask?

Minefield from Mozilla is an early build of the next version of Firefox with drastically improved Javascript engine under the hood. Some claim it has the fastest javascript engine on the planet, which means it leaves Google Chrome in the dust. You can download the alpha code of the latest nightly build for Mac OS X, Linux, or Windows.

I was also looking for a 64-bit browser, since I'm running my Kernel and the entire OS in 64-bit which means that my whole computing experience should be so much faster (and better), that would replace Safari, because in my tests after I left Safari with those 3 tabs open and left the computer for 5min, the memory footprint increased to 164MB!!! I also had Safari bringing my Macbook to its knees before with some dodgy flash web page.

In terms of browsing experience, I used Chrome for a while and it seemed faster than anything else. Opera was the slowest and Firefox somewhere in between. I disabled all the add-ons and just left a few essential plugins in FF to make tests more fair since Chrome beta for Mac doesn't even support plugins.

Anyways, I was looking for the smallest footprint browser and Opera seems the best by far, but it also "appears" slower than others. It seems the faster the browser, the more memory it uses. I will run Minefield for a while to see if 64-bit code has any benefit even though its a pre-release version.

Oh, and also the benefit of using Mozilla is that it can stream mjpeg natively (which is essential to my CCTV solution at home) while other browsers rely on the java applet to do the same.

Update: as of today there still no 64-bit Adobe Flash player for MacOSX. Apparently there's one for Linux (in Alpha), but not for Windows or Mac, so Minefield 64-bit won't play any Flash content.