Thursday 23 December 2004

Unexpected "feature" in Windows XP home Edition

I stumbled upon an unexpected "feature" in Windows XP Home Edition on Tuesday. Someone had found a photograph I had taken on DHD Multimedia Gallery but wanted a high resolution scan suitable for printing. So, back home, I found the negative of the picture and connected my Minolta Dimage Scan Elite 5400 to the only working computer I currently have in the house, an IBM ThinkPad T20, the same machine I tried to install Gentoo Linux on a few months back and on which I reinstalled Windows XP Home Edition.

It all started well. I put the negative in, did a first scan with no particular option, at 5400dpi, the highest resolution for the scanner. It gave me a whooping 16Mb JPEG image file that was equivalent to a 113Mb uncompressed image. But then because the negative is 8 years old and has gone through a few house moves, it has suffered a bit and had specks of dust I could not remove. So I decided to try the Minolta Digital ICE grain dissolver built in the scanner that is supposed to remove such specks of dust on the scanned image. It took a good 5 minutes to scan the image but it did a good job. So far, so good. Now, this scanner comes with another option to improve the quality of the scanned image so I decided to try that. The scanner started scanning. Then the machine started using its hard disk like mad, probably swapping because it only has 256Mb RAM. After a good 10 minutes of this, I decided I'd give up and tried to bring up the task manager to close the application. No chance there, the application just wouldn't close. By that time, it was using so much resources I was unable to do anything, even CTRL-ALT-DEL would not respond. The only solution ended up being disconnect the laptop from the mains and remove the battery. That stopped it alright.

After this, I restarted and was quite surprised when it didn't do a scan disk, considering how heavily it had been using it and how brutally I had stopped it. It still seemed to work though so I logged on to my account again to try something different. I started up Paint Shop Pro to do some manual tweaking of the image. The first task was to crop it to remove the edges, which in PSP involves doing a copy and then pasting the copy as a new image. So I selected the piece I wanted to keep, went to the Edit menu and selected Copy. The machine started to use its hard disk like mad once again. This time I decided to investigate and opened the task manager to look at performance and see what it was doing. This is when I realised that not only was the physical memory completely full but the paging file as well, which was an enormous 900Mb, which meant that the simple copy I was doing in Paint Shop Pro required more than 1Gb of RAM! That was bad enough. But what was worse is that Windows then warned me that I was getting low on memory so it would increase the size of the paging file, thus requiring even more resources, rather than stop the offending application. So it appeared that my machine was completely unresponsive and unable to let me stop the application because what was using the resources was not the application itself but the operating system's memory management that was trying to meet the demands of the application, even though it obviously couldn't. This time I was able to shut down the system properly.

Now this is bad because, by trying to be user friendly so as not to kill a user application that requires more memory than the system can offer, said operating system offers no protection against a misbehaving application that demands more memory than it should require or that the system can reasonably offer. It means that a memory leak in a badly written application can potentially bring the whole system to its knees in such a way that is impossible to recover nicely. It also means that, because it is impossible to subsequently reduce the size of the paging file, if the file keeps growing due to application memory demands, it could potentially end up taking an inordinate amount of disk space.

Fair enough, if I want to do image manipulation with images that take more than 100Mb in memory, I should really have a good desktop machine with lots of RAM. However, this discovery means that I'd rather not buy another Windows machine. Linux is not an option unfortunately because my scanner is explicitly not supported by SANE and I don't have the time nor the skills to develop a SANE backend for it, nor do I expect Minolta to develop one anytime soon. So I suppose the answer to my problem is to buy an Apple Mac with lots of memory and a good processor. I suppose I could think of a worse Christmas present for myself. And I don't even have the excuse that I can't find a good store, because Apple have just opened a brand new store in Regent Street.

Thursday 2 December 2004

Cool Technology

The Register has this article on liquid lenses for camera phones. Those lenses are designed and built by a French company, Varioptic and are really cool. Because they use a combination of water and oil, they can change shape, which means that the focal length of the lens can change without any moving part, a bit like the human eye does. As a result, you can have auto focusing lenses that fit into something a few millimeters thick and use much less power than a traditional lens. The ideal solution for a camera phone. And they reckon we might get the first models in the shops by 2006. I want one of these!