Main

June 29, 2008

MATLAB 2007b and Java heap woes

I had the issue where MATLAB 2007b would only start once after a cold reboot, and then refuse to start (the splash screen would pop up and immediately close). I finally sat on my posterior and traced it with process monitor; the very last step was writing to a java.log file in my AppData/temp; the contents suggested that the Java VM could not allocate the requested amount of contiguous heap space. This gave me enough keywords to find the following:

http://www.mathworks.de/matlabcentral/newsreader/view_thread/161788

I reproduce the relevant part of the thread (which cites a Mathcentral tech support message):

This error is currently under investigation. The current
workaround is to set an environment variable that will
bypass the error. Please try the following to start MATLAB:

1) Go to the Start menu to Control Panel.

2) Double click on "System" and go to the Advanced tab (for
Vista go to "System and Maintenance" to "System" to
"Advanced System Settings".

3) Click the Environment Variables button.

4) Click "New" under either option (System or User
variables) to create a new variable. The variable name will
be MATLAB_RESERVE_LO. The variable value will be the number
0 (zero). Press OK to save the changes.

EXPLANATION:

Setting MATLAB_RESERVE_LO=0 tells MATLAB to bypass the
functionality introduced in R2007b (for Windows only) that
tries to reserve the largest available contiguous space for
MATLAB arrays. This process guarantees that at least 256MB
is left available for use by Java for the Heap and PermGen
spaces. It appears that Windows is either loading a DLL or
doing a malloc somewhere in this 256MB space, so that when
Java tries to reserve the Heap and PermGen address space, it
fails, since both the Heap and PermGen spaces must be
contiguous. If MATLAB_RESERVE_LO is set to 0, the reserve
is for a fixed amount of space, not the largest available space.

May 19, 2008

AwesomeBar considered harmful

The "Awesome Bar" in Firefox 3 is so bad, that I had to post about it. Let me count the ways it blows:

1. The search is against web page titles, not just URLs. The bar only shows the URLs of pages you visit, so the principle of least surprise demands that you only autocomplete text entered in the bar with URLs. What is worse, there is no way to disable that behavior.

2. The search is not prefix-only. Whatever you type into the bar will be matched against any part of an URL or web page title. While word boundaries are matched preferentially, this is still bad, because it doesn't seem to work or put enough preference on the prefixes.

3. Each result is displayed on two lines, with different size fonts for the two lines. This is just bad typography and design. It is also an unnecessary waste of space.

4. The underlining of the match positions. This just blatantly points out all of the previous deficiencies, with bells and whistles. Yes, please draw my attention to the fact that you matched page titles!

Don't get me wrong - I have nothing against "adaptive learning algorithms". In fact, I am doing a Ph.D. thesis on a related topic. But every time I "train" the Firefox URL bar by correcting its mistakes, it trains ME not to use the bar.