Friday, May 30, 2008

Client side Memory Leaks IE and GWT - Introduction

I believe that software development should be fun. This is why for a long time I avoided the wild world of client side and JavaScript. Even though there is a big traction toward AJAX and WEB2.0 I am still not convinced that a group of average developers can develop a large scale, maintainable, enterprise ready and long lasting project based on this technology. JavaScript in just not that kind of language and the freakishly incompatible Browsers world which do not supply comprehensive set of monitoring tools is absolutely a nightmare. Moreover this world is ruled by IE, the two headed beast, which encompasses two GC mechanisms each one of them is not aware to the other. It is so easy to introduce new memory leaks and it is so hard to eliminate them.

I am currently involved in a project written in GWT. I must admit that on the first look this ambitious technology looks quite promising. Developing in Java is much better than JavaScript, GWT offers mitigation to browser incompatibility and IE memory leaks.

Indeed, development phase was quite productive developers did enjoy to develop the code and delivered fast results. (Complications came back when JavaScript native code needed to be written in order to supply needed functionality not supported by GWT--> we were back in the JS alley)

When we approached stabilization phase things became nasty. On one hand performance optimizations where required and we could not ignore the fact that the target engine was JavaScript engine. Moreover the biggest nightmare was memory leaks in IE 6/7. Each indirect circular reference between the DOM and the JS engine caused the entire JS to be locked in memory leading to megabytes of leak. The effort needed to solve memory leaks was huge and involved most of the code written. I will not delve into project constraints and design criteria that might have made this problem so acute. I want to focus on some guidelines to help in avoiding and solving memory leaks. Since this post is getting a bit long I will split those guidelines to the next one.

And one good news to close this post: I opened a bug to Google regarding a memory leak when closing a window 5 months ago. I forgot all about it, buts suddenly out of the blue I got an email. Bug was verified and fixed. Fix will be available for GWT1.5

Tuesday, May 27, 2008

Moore's Law for the average Mosquito

I really planned to go to sleep, but I was really amazed by the amount of mosquitoes that one have to hunt before he can go to sleep quietly. It suddenly occurred to me that the average mosquito is becoming twice as fast every approx two years. It is maneuvering much better. It's flight is much more silent and its bite is becoming stronger.

When are we going to see dual core mosquitoes?

System.out.println("Hello World!");

Hello world
I wanted to open a professional blog for a long time. It took me a few months to convince myself that I can transform this desire into commitment. I have a lot of thoughts related to java and performance that I want to share with you all. I really hope it will be a trigger an effective and lively discussion.

There goes away one hour of sleep a day... I hope that I will not fall asleep in the middle of the posts :-)

So, now I will check again that post title is not empty and....