Blog

Saturday, March 20, 2010
This blog has moved
This blog is now located at http://blog.jdtangney.com/. You will be automatically redirected in 30 seconds, or you may click here. For feed subscribers, please update your feed subscriptions to http://blog.jdtangney.com/feeds/posts/default.

0 comments

Friday, February 26, 2010
Programming with Scratch
I just finished teaching the first of four classes on programming with Scratch. The students are 5 Middle Schooler-aged girls. The purpose is to give them an introduction to programming with a eye to eventually programming LEGO Mindstorms robots in Java.

0 comments

Thursday, February 18, 2010
Nice Javascript tooltip package
Walter Zorn has done a great job of this little package. The feature set is exactly what we needed, and it is dead easy to use. In the documentation on his web site, every config parameter is illustrated with a live, working example. Herr Zorn is clearly detail-oriented! wz_tooltip is LGPL.

I clicked on the "donate" button and sent a few bucks. Thanks, Walter!

0 comments

Thursday, February 11, 2010
Test harness for Roku's BrightScript

Roku has finally released their SDK for making "channels". Unfortunately, the Roku box runs a proprietary, BASIC-like, non-OO language called BrightScript. Happily, Mark Roddy has written a test harness so you can TDD in BrightScript.

Labels: , ,

0 comments

Friday, January 22, 2010
Tomcat PermGen – a fix?

While decent folk were asleep, I was profiling Tomcat. (YourKit rocks, funky UI notwithstanding.)

I found that our PermGen woes of old were indeed caused by classes not unloading. I was inspired by this how-to and yes, we do leak an instance of WebappClassLoader which has a reference to every class the app ever uses. Why?, I hear you ask.

There's a java.util.TimerThread named "MySQL Statement Cancellation Timer" that does not terminate when the app is unloaded and so it hangs on to the class loader, which in turn hangs on to every class under the sun. For a rigorous explanation, read the MySQL bug report.

According to that bug report, the MySQL developers capitulated and as of not that long ago, this is the status:

[18 Dec 2009 23:24] Mark Matthews

Fixed for 5.1.11. Unfortunately no great fix exists that lets us keep the cancellation timer shared amongst connection instances, so instead it's lazily created if need be per-instance, and torn down when the connection is closed.

So in theory, we can get rid of this problem by upgrading our MySQL Connector (JDBC driver) from 5.1.10 to 5.1.11.

If I have time over the weekend, I'll be testing the new JDBC driver with GH and monitoring it closely with YourKit to see if the new driver solves the problem.

Labels: ,

0 comments

Thursday, January 21, 2010
Remote monitoring of Tomcat

Got memory leaks? Dogged by OutOfMemoryErrors?

JDK 1.5 and later come with jconsole.

First you have to tell Tomcat how to publish it's inner workings for jconsole. This process differs by platform and also depends on how you installed Tomcat.

The typical MacOS X install consists of downloading the zip and expanding it somewhere. The "somewhere" is your CATALINA_HOME. If that's how you installed Tomcat, go to $CATALINA_HOME/bin and create a file called setenv.sh. Into it put this line:

export CATALINA_OPTS="-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=8086 -Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false"

On RHEL, Tomcat is typically installed via rpm – I use yum. In that case, you need to add the CATALINA_OPTS to /etc/sysconfig/tomcat6 Leave out the "export" since this file is not a shell script.

Now reboot Tomcat and you're good to go.

Connecting is trivial. Start jconsole. On MacOS X, simply type jconsole at the command line and it opens. For other other platforms, let me know and I will add it.

When jconsole comes up, it will have discovered any local tomcats so simply connect. For a remote tomcat, connect using port 8086 as specified above, and leave user name and password empty.

That's it!

Labels: , ,

1 comments

Saturday, January 02, 2010
Ah, geek humor
I enjoyed this a lot:


0 comments

AddThis Feed Button

Twitter Updates

    follow me on Twitter

    Archives