I turned off caps lock

Tools, Windows No Comments »

because I can not remember when I really needed it the last time. Most of the time I press it accidentally and get into troubles.

A quick web search brought up this page describing how to disable the Caps Lock on various systems and links to annoyances.org for more information. I chose the first method by downloading the registry key and adding it to my system.

Again Troubles with vmware and CPU speed

Software, Tools, Windows No Comments »

I already posted a while ago that I had problems with the clock speed of my notebook and vmware guest systems. There are a lot of online resources about this problem. They state out that the power saving features of mobile processors could cause troubles in clock synchronization between host and guest systems.

There are additional articles in the vmware knowledge base about Configuring Virtual Machines to Run on a Laptop Host Computer. They all discuss the problems with Intel SpeedStep and CPU clock timing.

After applying the settings for the time stamp counters from the articles I did not get better results. I was wondering because I remembered running virtual machines on my notebook without a problem.

I tried to update the BIOS of my notebook to the newest version and after rebooting everything worked fine. It did not matter if I tried a Windows or Linux guest system - the clock was synchronized. Two days later I used the virtual machine again - and the problem was there again:

I tried all tips stated out in knowledge base article 928, 1236 and 2039 but nothing worked. I found out that after putting my notebook into hibernate and starting it again the clock synchronization does not work anymore. When I do a complete reboot everything works fine again.

Truecrypt update available

Software, Tools No Comments »

truecryptLast week Truecrypt version 5.1 was released. I downloaded and installed it today. Everything works fine so far, my encrypted volumes still work ;) The performance improvements they made are not recognizable for me because Truecrypt already worked smooth and fast with the 4.x versions for me.

Fixing memory leaks of Internet Explorer 6

Software, Tools, Web No Comments »

Lately we experienced a lot of performance problems in our AJAX applications. Since we went online a year ago we always had problems with users of Internet Explorer 6 but within the last three months they got more and more.

We already knew that this had something to do with the huge memory amount the Internet Explorer 6 uses after some hours of working with our application. I used the Process Explorer to analyze which page causes the problem. After identifying the page I did some reloads of it and generated the following image:

leaking ie

As you can see, with every reload the memory amount consumed by the Internet Explorer 6 increased (for about 2 megabytes). This memory amount was never released, even if a complete different page of the application was loaded. The only way to release the memory again was to close the instance of the browser.

I did a web search and found this interesting link about “Understanding and Solving Internet Explorer Leak Patterns”. It describes four different situations that could lead to memory leaks in Internet Explorer by using good graphics and example code.

I was really shocked when I realized that the Internet Explorer 6 holds those elements in memory even after the user left the page and loaded another one. In other browser it is just important to make sure that inside the page the references to elements are released proper when working with a lot of AJAX code without reloading the page.

We are using prototype and scriptaculous as JavaScript libraries. Another library used to display a clickable calendar for date input fields is the JSCalendar from dynarch.com. To find out which elements of the DOM and which script code cause the memory leak I searched for another tool – and found sIEve.

With sIEve it was easy to detect to suspicious elements. After reloading the page inside of sIEve a lot of possible leaks were detected and the list looked like this:

sieve leaks

By looking through the code of the page I found out that all the elements in the list had events registered (onclick, onkeyup, onchange, …) and the assigned methods contained closures (see this link for details again).

Some were caused by the used calendar library. I already sent an email to the author Mihai Bazon. He wrote a very good article about the problem and I could not believe that there is exactly that bug inside his library. Maybe we are using it incorrect.

The other leaks were caused by prototype. Although prototype has a built in mechanism that should unlink registered events when the page is unloaded they survived the reload. I found out that there is a bug in the 1.6.0 version of prototype. The mechanism was changed between version 1.5 and 1.6. This explained why the problem got bigger after updating out application to the new prototype version.

To fix the problem I registered a method to the unload event of the page that removes all the critical registered events. This looks like:

1
2
3
4
5
6
7
8
function breakLeaks() {
	$('img_calendar').onclick = null;
	Event.stopObserving("fieldX", "keyup", keycheck, false);
	Event.stopObserving("fieldX", "click", mousecheck, false);
		...
}
 
Event.stopObserving("window", "unload", breakLeaks, false);

After changing the page like that I tested it again with sIEve and no more leaks were detectd. Then I used the Process Explorer again to monitor the memory consumption of the Internet Explorer. The graph now looked like:

noleak ie

The memory footprint is a lot smaller now and memory allocated by the reload was completely released again.

Internet Explorer VPC Images

Software, Tools, Web, Windows No Comments »

ieMicrosoft now provides all of its Internet Explorer versions in separate downloadable virtual PC images. This is extremely useful for web developers because it allows them to test their applications for compatibility.

Google Webmasters Tools

Software, Tools, Web No Comments »

GoogleToday I found this post on problogger.net that made me aware of another Google tool I did not use until now that could be very helpful. I am talking about Google Webmasters Tools. Google Webmasters Tools allow you to see a website from the view of the Google crawlers. This means it is possible to check a lot of statistics like the top queries in specific months or to see what words went into the Google search index.

Another very interesting feature is to list all the external links to the specific page of your site and in total. This tells me I definitely have to get more links pointing to my blog ;-)

This tools is a nice addition to the other Google tools I use to manage my blog, which are Analytics, Alerts, AdSense and AdWords.

VIM screencasts

.NET, Eclipse, Java, Tools No Comments »

vilogoAaron postet two screencasts on his blog showing how to use VIM. I really love VIM - I thought about installing the viPlugin for my favorite IDE Eclipse some months ago. Now these videos made me think again - I think I will give it a try. Checkout the two casts:

  1. VIM Screencast 1 - basic usage (navigation, modes, …)
  2. VIM Screencast 2 - commands with motion (yank, change, …)

There is even a vi emulator for you Visual Studio users out there - it is called ViEmu.

Again: I love Launchy

Software, Tools, Windows 1 Comment »

Nearly a year ago I stumbled upon a post on lifehacker about Launchy. I downloaded, installed and used the tool - and I had to blog about it.

Now for everybody who does not know it until know: I love Launchy! It is THE tool that improved my whole using-a-PC-experience to most in the last year (next to using Google Reader).

launchy

Launchy creates an search index of all the shortcuts on your PC so you can start any application by pressing ALT+Space and entering a part of its name. It is also possible to open web bookmarks and do calculations. You may even extend its functionality with plugins.

It increases the speed of working with Windows a lot because you do not have to get your hands of the keyboard just to open an application.

Spring with AspectJ in Eclipse

Eclipse, Java, Software, Tools 2 Comments »

SpringSome weeks ago I wrote a custom JSP tag for a Spring project I am currently working on. Inside the tag I wanted to use a Spring bean. Soon I realized that this case had to be handled a bit different because the tag is instantiated by the application server and not from the Spring context. Therefore the simple standard injection mechanism did not work.

Using the Spring documentation I found out that I had to use AspectJ for dependency injection in this case. I added the @Configurable annotation to my tag class. I added the required configurations to the XML files:

1
2
<context:spring-configured />
<bean class="net.einwaller.spring.Tag" lazy-init="true" />

To get the required classes in the classpath of my application I had to add the libraries aspectjrt.jar and spring-aspects.jar. The first approach I took for weaving the aspects into my classes was load time weaving. I achieved this by adding the following to the VM arguments of my Tomcat instance:

-noverify -javaagent:pathtojar\aspectjweaver.jar

The noverify option was needed because the version of log4j caused a problem when starting the server without the option. I configured the path to my aspectjweaver.jar as an absolut path.

Having done all these steps I got my application running again but the load time weaving was a bit annoying. I was not able to change the code of my application while the server was running. The Java VM hot code replace did not work anymore. Restarting the server for every change slows down development performance a lot. So I searched for a better solution.

First I installed the AspectJ Eclipse plugin. I wanted to use the AspectJ compiler for compile time weaving of the AnnotationBeanConfigurerAspect. To do so I had to convert the project into an AspectJ project which changes the compiler and adds some project preference pages (RMB -> AspectJ Tools -> Convert to AspectJ Project).

Afterwards I had tried to add the spring-aspects.jar to the Inpath of the AspectJ Build preferences but that did not work. I moved the JAR file out of the WEB-INF/lib folder and tried to add it again - and it worked! Seems like the AspectJ plugin has some problems withe the classpath of the WTP plugin.

Now I got the shiny AspectJ markers at the top of the classes I marked with the @Configurable annotation. The application runs inside the Tomcat after removing the VM arguments for load time weaving and hot code replace works again - perfect!

Skype upgrade issues

Downloads, Software, Tools No Comments »

Today I tried to upgrade to the newest Skype version 3.6.0.244 but I had some issues. Every time I ran the installer it stopped in the middle of the process showing me the following error message:

SkypeError

I found this forum post describing how to get rid of Error code 1603. Therefore I just had to download the Windows Installer Cleanup Utility and remove the Skype Plugin Manager.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in