Madison proclaimed Best College Sports Town, Again

My friend Joe Gregorio posted a link to the Money Magazine article ranking Apex, NC, the city where I currently reside, as the 14th best city in America in which to live. That is great, but I have better news.

My profile doesn’t state it, but I am an alumni of the University of the Wisconsin Madison and a Badger to the core. Few things make me happier than seeing in print what I already know in my heart to be true. Madison is the best college sports town in America, nay the world. One of the more memorable proclamations was written in Sports Illustrated with this 2003 article. Now ESPN has jumped on the Madison bandwagon with Scott Van Pelt’s reaffirmation that UW-Madison belongs in the #1 spot (mp3 found here).motionwsmall.gif

Hogwash you say, another homer proclaiming his alma mater as the best in the nation, nothing new here. Well as it so happens one of the benefits of working for I‘ve Been Moved is having the opportunity to inhabit many different cities. While working at IBM I’ve lived in some of the other cities vying for the #1 spot, including Austin, TX and The Triangle (Chapel Hill and Durham NC) areas. Let me tell you, while each of these areas have their charm, Madison does stand alone as the best college sports town…in the world. Period.

Let me end by saying: “On Wisconsin!” and “Go Badgers!”

The Java space vs time trade-off

QT is popular application development framework used most notably in KDE where it is -the- toolkit of choice for programmers. Recently QT has added bindings for Java, Ruby, python, C#(Mono), to go along with its legacy C++ bindings. colliding mice QGraphicsView example. It results illustrate the typical Java space vs time trade-off

Here are the memory figures from top with the ratio to the C++ value in brackets for the bindings languages:

  • C++ virtual: 15.6Mb resident: 7.3Mb shared: 9.9Mb
  • QtJambi (java-6-sun-1.6) virtual: 239Mb (15x) resident: 46Mb (6.27x) shared: 20Mb (3.24x)
  • QtRuby virtual: 33.2Mb (2.13x) resident: 16Mb (2.18x) shared: 9.9Mb (1.6x)
  • Qyoto virtual: 45Mb (2.88x) resident: 17Mb (2.32x) shared: 12Mb (1.94x)

So QtRuby and Qyoto/Mono use about twice the memory of C++, and QtJambi uses twice as much again. Next I divided the ‘real time’ by the ‘user time’ plus ’system time’ figures, and calculated the mill consumption relative to C++:

  • QtJambi (java-6-sun-1.6) 1.8 times slower
  • QtRuby 4.1 times slower
  • Qyoto 5.0 times slower

We haven’t done much performance tuning for the Qyoto bindings yet, and it may be possible to speed them up and beat ruby…….

……

……

I haven’t got a current version of PyQt to try the same test, but I would expect it to be pretty much as fast as QtJambi and consume about the same memory as QtRuby or Qyoto though.

The plight of Rohan

It often amazes me how much life imitates art, and this post is a foray into exploring this subject matter . I know this a bit of a departure from the normal technical nature of my blog but I thought I’d take a shot at branching out a bit.

Wormtounge

I’m a big fan of J.R.R. Tolkien. I’ve read The Hobbit, The Lord of the Ring trilogy and watched Peter Jackson’s movie adaptations. Every time I re-watch the movies or re-read the books I see something new. This time through I was struck by the plight of the Eomer and the Rohirrim, the people of Rohan, when Grima Wormtongue and Saruman held sway over King Theoden.

In Tolkien’s world Rohan is a proud land whose people are farmers and horse herdsmen by nature known to Middle Earth as the Horse-lords. Historically the Rohirrim are honorable people fighting on the side of good against their mortal enemy, the evil orcs. During the time of the Lord of the Rings books Rohan ’s King is Theoden, decedent Eorl, and its marshal is Eomer, Theoden’s son-in-law.

When the reader is introduced to King Theoden he is the once benevolent and wise monarch of Rohan who is both possessed by the then evil wizard Saruman and manipulated by Rohan’s cheif Counselor, Saruman’s silver tongued servant Grima Wormtongue. Together the evil duo control King Theoden and thus run Rohan.. In the movie King Theoden looks feeble and unable to communicate except through Wormtongue. Luckily for Rohan, Gandalf and the Fellowship arrive to expel Saruman from Theoden and defeat Wormtongue reviving the Theoden of old.

What strikes me is how truly fortuitous the arrival of The Fellowship is for Rohan. Just prior to Wormtongue’s overthrow he is for all practical purposes ruling Rohan. Rohan’s people are at Wormtongue’s mercy, or lack there of. Most citizens are in no position to oppose Grima so they seemingly have no choice but to watch their proud kingdom deteriorate and be overrun with evil creatures. There are some in Rohan, such as Eomer, who once had the King’s ear, but even for them opposing Wormtongue comes with great risk. Opposition is likely to be ignored at best and considered treason at worst. In the story, Eomer raises the suspicion of Grima leading to banishment from his homeland.

If the Fellowship had not arrived what were the Rohirrim to do? Their options seem limited: leave Rohan and abandon their homeland, live in misery under the thumb of Wormtongue, revolt against Wormtongue (likely leading to banishment), or due the unthinkable and overthrow both Theoden and Wormtongue. Near unanmiomous agreement and cooperation among the Rohirrim would be needed for either of the last two options to work, an unlikely proposition in place with historical monarchy. Further, the people’s decision is complicated by the fact that they know King Theoden to be a good man. This is not like the situation in North Korea where the people have been brainwashed into believing their dictator, Kim Jong-il, is a god, nor is it like the old Soviet Union where most hated their government but were to fearful to do anything about it. No, the people of Rohan know Theoden as good man who up until recently has been a wonderful king, so there is a great deal of well deserved loyalty to King Theoden. The fact that Theoden has fallen under the sway of Saruman and Grima Wormtongue is probably not known to many. For all the Rohirrim knew their king had been hit by a string of bad luck making his decisions turn disastrous. Is this call for overthrow or abandonment after years of good times under his reign?

Sometimes it seems this happens more often than recognized in our every day life. People become so dependent upon a certain set of advisers they are unable or unwilling to listen to other points of view or reassess the situation with a fresh pair of eyes.

HeapDumps: What are a they? Why would I want one? How do I generate them? How do I view one?

In response to my last post a colleague said:

Good post…..how did you create the HeapDump, and how did you view it?

Good questions.

A HeapDump is simply a dump of the live objects in a JVM’s heap at a given point in time. HeapDumps are usually used to debug memory leaks or to find the big memory consumers within a JVM. While most JVMs provide the ability to create HeapDumps the generation techniques vary from JRE to JRE.

IBM’s JRE has many options to deal with the generation and format of it’s HeapDumps, for all the details take a look at the the diagnostic guide. By default a HeapDump is only produced when an java.lang.OutOfMemoryError is hit. This can be seen by executing “java -Xdump:what”


gissel@uw-t60p:~/Workings/leak> java -Xdump:what

Registered dump agents
———————-
dumpFn=doSystemDump
events=gpf+abort
filter=
label=/home/gissel/Workings/leak/
core.%Y%m%d.%H%M%S.%pid.dmp
range=1..0
priority=999
request=serial
opts=
———————-
dumpFn=doSnapDump
events=gpf+abort
filter=
label=/home/gissel/Workings/leak/
Snap%seq.%Y%m%d.%H%M%S.%pid.trc
range=1..0
priority=500
request=serial
opts=
———————-
dumpFn=doSnapDump
events=uncaught
filter=java/lang/OutOfMemoryError
label=/home/gissel/Workings/leak/
Snap%seq.%Y%m%d.%H%M%S.%pid.trc
range=1..4
priority=500
request=serial
opts=
———————-
dumpFn=doHeapDump
events=uncaught
filter=java/lang/OutOfMemoryError
label=/home/gissel/Workings/leak/
heapdump.%Y%m%d.%H%M%S.%pid.phd
range=1..4
priority=40
request=exclusive+prepwalk
opts=PHD
———————-
dumpFn=doJavaDump
events=gpf+user+abort
filter=
label=/home/gissel/Workings/leak/
javacore.%Y%m%d.%H%M%S.%pid.txt
range=1..0
priority=10
request=exclusive
opts=
———————-
dumpFn=doJavaDump
events=uncaught
filter=java/lang/OutOfMemoryError
label=/home/gissel/Workings/leak/
javacore.%Y%m%d.%H%M%S.%pid.txt
range=1..4
priority=10
request=exclusive
opts=
———————-

This is a good setting when running in a production environment, but not the best for debugging. When debugging I usually like to take several HeapDumps during a test, as the heap grows, to see what what type of object is growing. This is best done by sending a SIGQUIT signal to the JVM process. To enable the creation of HeapDumps via the SIGQUIT signal set the JVM option “-Xdump:heap”. The total effect of this option can be seen by executing “java -Xdump:heap”


gissel@uw-t60p:~/zero-1.0.0.P20070712-1334/apps/employee.demo> java -Xdump:heap:?
JVMDUMP000E Dump Option unrecognised: -Xdump:heap:…?

Capture raw heap image:

-Xdump:heap[:defaults][:<option>=<value>, …]

Dump options:

events=<name> Trigger dump on named events
[+<name>…] (see -Xdump:events)

filter=[*]<name>[*] Filter on class (for load,throw,catch,uncaught)
#<n>..<m> Filter on exit code (for vmstop)

file=<label> Output file
range=<n>..<m> Limit dumps
priority=<n> Highest first
request=<name> Request additional VM actions
[+<name>…] (see -Xdump:request)

opts=PHD|CLASSIC

Default -Xdump:heap settings:

events=gpf+user
filter=
file=/home/gissel/zero-1.0.0.P20070712-1334/apps /employee.demo/
heapdump.%Y%m%d.%H%M%S.%pid.phd
range=1..0
priority=40
request=exclusive+prepwalk
opts=PHD

Could not create the Java virtual machine.

An interesting option is “opts”. As seen above, the default “opts” value is PHD. PHD is actually the format of the HeapDump the other options are CLASSIC(text file), and PHD+CLASSIC (produces 2 files for each requested HeapDump, one in PHD and the other in TXT format). The HeapDump file format is important because some of the tools can only read either PHD or TXT format.

The tool I use to view HeapDumps varies depending upon which tool is most up-to-date . Currently, the first tool I use to get a general feel for what is in the heap is HeapAnalyzer. I also like HeapRoots.

heap_small1.JPG