Thursday, December 29, 2011

Happy new year from the book publishing department

My first book, A Mentoring Course on Smalltalk, is now available in PDF format. You can get it here (plus all my books are listed here). Enjoy!

Friday, December 16, 2011

Firefox 8 data cache cleaning

By default, my installation of Firefox uses up to 1 gb for file caching. Firefox uses a nice 16x256 (or similar) directory structure so that not all files are stored in the same directory. This is nice! However, when you ask Firefox to clear the cache, Firefox deletes files from this directory structure in (apparently) random order. This is Bad(TM):

  • That's a lot of directories! Using du -sh ? at the root cache directory will show that progress is made in a random fashion. Moreover, if you keep doing du -sh ? on the command line, then directories stay mostly cached and you can see progress is fast (meaning: slow, but not frozen molasses slow). If you wait a while, then directories don't stay cached and progress becomes (frozen molasses) slow again.
  • For some reason, it looks like OS X won't do write combining anywhere as efficiently if you delete files at random from the directory structure. The activity monitor showed about 4mb / sec disk writes throughout. However, the result was super slow deleting.

After about an hour, Firefox still had to delete about 700 mb of files. So I decided to help, and run commands such as rm `find F -type f -print` at the root of the cache directory. Apparently Firefox doesn't mind not finding files it wants to delete, and rm keeps going if it can't find a file to delete, so things went well. The rm command deletes files sequentially in the same directories, so I expected it to run faster. And yes indeed, it was quicker by a lot. I was done deleting the rest of the files in no time. I should also point out that, even though at times there were effectively two rm threads (Firefox, and the command line), actual disk i/o throughput was not higher and remained at about 4 mb / sec. Nevertheless, actual deleting performance was way faster.

Firefox developers: please delete cache files sequentially, yes? Also, Memshrink is awesome and it makes a huge difference, please keep going!

Sunday, December 11, 2011

Windows 7 32 bit install freeze while "Completing installation..."

On a Macbook Pro, installing Windows 7 32 bits on the boot camp partition may freeze after the first successful reboot at the "Completing installation..." phase. Also, when you kill the computer to unfreeze it, your installation is trashed and you have to start over again. There are a multitude of suggestions on how to deal with this problem on the web. This is a summary of what I figured out.

After the first reboot, I told the installer to boot into safe mode. This stops the installation from proceeding and trashing the install when it crashes. With e.g.: shift+f10, open a command prompt and then execute compmgmtlauncher. This brings up the computer management console. Look under the device manager and browse through the devices. In my case, I could freeze the computer just by looking at the ethernet controller. Interesting...

But how to work around it? Disabling the device didn't help because the installer crashed anyway. So I took out memory from the machine and left it with 2 gb of RAM (and no, the memory is not bad). At this point, the device manager didn't hang anymore after browsing the ethernet controller. When I rebooted and let the installation proceed, this time it completed successfully. Note that the installer recognized and installed the ethernet controller drivers correctly. Once Windows 7 was installed, I restored the memory back to what it was before. Everything seems to work fine so far.

From this experience, it looks like device recognition during the installation may induce failures when you have more than 2 gb of RAM. How bothersome :(.

Tuesday, December 06, 2011

Holiday Lulu coupons

FYI, Lulu is running interesting coupons these days. First they had free shipping, and now they offer 30% off until Wednesday with the coupon WINTERSAVE305. So if you wanted to get anything from Lulu you didn't get before, this is a good time to do that.

Monday, December 05, 2011

Talking about GC at Willamette University on 9/12

Willamette University's Math Department graciously gave me a slot in their colloquiums. I will be speaking about garbage collection on December 9th at 4pm. I hope you can make it! See you at the Ford building on Thursday.

Update: the talk was well received by an audience of mostly students from the Math and CS departments. I'd guess there were between 40 and 50 people, it was hard to tell because the room was full all the way to the back. I'd like to thank Willamette University again for this opportunity.