Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Milton Keynes 50th Anniversary

2017, mk

I can’t believe it’s been ten years since the last celebration of Milton Keynes' life; this time, celebrating fifty years of our city. There are a number of planned activities for the upcoming year; a calender of events is at http://www.mk50.co.uk/whats-on if you’re interested.

When we moved down from Scotland to Milton Keynes in the early 2000s, we didn’t have any specific constraints of where to live or family ties that kept us in a particular area. I still had International Object Solutions Ltd, and since my work mainly involved travel to Europe there wasn’t any difficulties, as long as there was good airport connectivity and good rail connectivity to London, we could have moved anywhere.

We looked at a number of places in commutable distance to London, but sufficiently far away that we’d still be able to enjoy the countryside, the night sky, and have a decent sized house for a decent amount of money. As a result, we looked at a wide arc from Reading, High Wycombe, Stanstead and even out to the East towards Bluewater. (For various reasons, going round the South was unlikely due to house prices and connectivity – given the ongoing Southern Rail disputes, probably just as well.)

A lot of them had individual advantages but when we got to Milton Keynes we found that it had all of them in one place. As a growing town, there were a lot of new builds (and therefore the house prices weren’t artificially inflated due to lack of demand) and it had good connectivity into London Euston. Virgin Trains have generally been an excellent train company (in fact, I’m writing this on one right now) and the commute has sped up from 45 minutes to 30 minutes with the introduction of Pendelinos and the upgrades to the West Coast mainline. Alas, we may lose that when HS2 finally rolls off next year but I’m hopeful that some Virgin Trains will still pass through Milton Keynes, though that’s looking pretty unlikely.

So why don’t people like Milton Keynes? Well, mostly it’s those who don’t live here; the roundabout/grid system confuses them. It does take a (brief) bit of getting used to – the main road are lined up in vertical (V) and horizontal (H) roads, with roundabouts at the intersections. Most of these roads look the same, and if you are confused because of referential navigation then it can be pretty daunting. But once you realise that all the roads are numbered (as well as named) at each intersection, it’s pretty easy to figure out where you are and use that to find out where you need to go. For example, we’re off H6 and V3 which gives people enough information to get to within walking distance of our house, although it’s pretty easy to then direct them from there to our place. In addition, most grid roads are national speed limit; either 60mph for single carriageway or 70mph for dual carriageway. My trip home from the station at night averages around 55mph. The downside of course is the wear on brakes and tyres; Milton Keynes has a higher wear rate than the rest of the country …

Inside each grid cell we have local roads that are 30mph. So they’re safe for kids to play next to and cycle on; but Milton Keynes also has one of the largest networks of cycle paths and walkways (known locally as “redways” due to the red coloured tarmac laid down for them). So if I want to, I can cycle to and from the station and not cross anything other than a local road; and with the introduction of Santander Cycles in MK (aka Boris Bikes) I can even rent one and return it to the local stop by Morrissons for £1.

We’ve also got many woods and lakes around the area; our local wood Howe Park makes for a beautiful walk in the Summer (though it looks pretty fetching in Winter too) and both Furzeton lake and Caldecote lake are great for an extended walk with the dogs. In most cases, these are walkable from our house, though Caldecote is a little further away and probably merits driving. And both lakes have a pub at the start/finish line which is a great way to unwind afterwards.

So has Milton Keynes met expectations? Definitely, and then some. Both of our kids were born in Milton Keynes and have grown up and gone to school in the local area, the commute into London is faster than someone living in Zone 4, and the quality of life is such that actually we rarely feel the need to leave the Milton Keynes area. It truly has become our home, and we couldn’t imagine living anywhere else in the UK.

That said, with the way that the UK is going, it is quite possible we’ll end up emmigrating to a more enlightened country at some point in the future. With the old generation squandering our children’s future, we can’t help feel that they’ll be better off somewhere else in the world. We’re not sure where that’s likely to be – obviously not America at the moment – or when the move will happen, but that’s about the only reason why we’d consider moving away from here.

EclipseCon 2016: Optimising Eclipse Plug-ins

2016, book, eclipse, eclipsecon, java, perforfmance

It doesn’t seem that long ago since I was last at EclipseCon Europe, but time has flown by – and my hair has gone even more grey 👴🏻 – someone complained that my headshot was out of date!

In any case, as with last time, I’ve managed to negotiate a discount on my newest Eclipse book – Eclipse Plug-in Development for Beginners, 2nd ed – which came out earlier this year. You can get 30% off the eBook until the end of October with CONECD30, or you can reach out to me via @alblue on Twitter if you’re interested

I’ve also got a pair of my Eclipse Plug-in books (Eclipse Plug-in Development, second edition, and Mastering Eclipse Plug-in Development) that I’m going to give away to someone randomly chosen from those who retweet this link 🐦, and will hand it out after my session on Thursday before lunchtime. I’ll tweet out the winner of the books before my session starts, and you can meet me at the Bürgersaal 2 room at 11:35 or shortly thereafter.

My session is on optimising Eclipse plug-ins; a generally useful overview for how to optimise Java programs generally, but also tailored to some of the specifics that affect Eclipse and OSGi applications. I’ll talk about how to measure Eclipse’s use with Java Flight Recorder and Memory Analyzer Toolkit, as well as touching on YourKit and Censum as well. Slides will be available on my speakerdeck profile afterwards. I’m also happy to have a discussion over lunch in more detail if anyone is interested.

JavaOne 2016: HotSpot Under the Hood

2016, assembly, hotspot, hsdis, java, javaone, openjdk, presentation

CON3808 Under the Hood of the JVM: From Bytecode to Assembly

JavaOne I’ve just given a presentation at JavaOne 2016, entitled “HotSpot Under the Hood”. It’s a new version of the talk I gave for the DocklandsLJC earlier on this year.

Unfortunately the talk wasn’t recorded (ony a few of the rooms appear to have any video recording in them) but the video from the above DocklandsLJC talk has just been published on InfoQ. It’s mostly the same presentation as before, but the JavaOne version was formatted to widescreen and a few additional slides were added (hopefully self sufficient).

Seventh best sesion for Monday

The talk came 7th the “Best Session @ Conference” for Monday; out of over 100 talks that’s not too shabby for a JavaOne first timer!

I’ve uploaded the version of the presentation that I gave at JavaOne to my SpeakerDeck account, if you want to step through the slides individually. And if you’d like to hear the sound of my dulcet tones, I have recorded a narrated version of the presentation at Vimeo.

Building hsdis

You don’t actually need to clone the whole OpenJDK repository in order to be able to compile hsdis; you just need to be able to grab the files from the hotspot/src/share/tools/hsdis/ directory. Specifically, you need to download:

There’s also a README file, which is useful but not necessary.

To build, you’ll also need to download binutils and expand it to a directory build/binutils.

Or, you can just copy and paste the following into an appropriate directory:

Building HSDIS
1
2
3
4
5
6
curl -O -O -O -O https://raw.githubusercontent.com/dmlloyd/openjdk/jdk9/jdk9/hotspot/src/share/tools/hsdis/{hsdis.c,hsdis.h,Makefile,README}
mkdir -p build/binutils
curl http://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.gz | tar --strip-components=1 -C build/binutils -z -x -f -
make both || make
# make both # for dual 32-bit and 64-bit platforms
# make      # for single-type platforms

This will download all the necessary files, run the build, and you’ll be left with a number of .dylib (for macOS) and corresponding .so and .dll for other platforms.

The macOS platform can support building and using both 32-bit and 64-bit binaries on the same platform; however, Linux platforms generally can’t handle both types.

Note that if you’re building on Windows with Mingw, you’ll need to replace the AR command with ${MINGW)-ar, in the same line that changes the CC variant for ${MINGW}-gcc. Ideally this should be fixed upstream but championing a fix is non trivial.

Command Options

The command options that I used in the talk were as follows:

  • -XX:+UnlockDiagnosticVMOptions – needed for the vast number of -XX:Print* flags
  • -XX:+PrintInterpreter – dump the template interpreter table
  • -XX:+PrintCompilation – show the compilation of methods as they occur, and what level they run as
  • -XX:+PrintAssembly – dump the assembly code for methods as they are compiled
  • -XX:+/-UseCompressedOops – turn on (or off) the ability to compress OOPs on a 64 bit JVM (defaults to on for less than 32G)
  • -XX:+/-UseCompressedClassPointers – turn on (or off) the compression of class pointers (defaults to on for 64 bit platforms)
  • -XX:ObjectAlignmentInBytes=8 – align objects on 8 byte boundary. Must be multiple of 2. Can use up to 64G if set to 16 but caution/testing required.
  • -XX:+/-TieredCompilation – defaults to on for Java 8 but off for Java 7

When you’re using OpenJDK flags, it’s sometimes a benefit to add -version to the end so you don’t get the help usage. For example, if you want to see what all the flags you can use -XX:+PrintFlagsFinal -version which will dump everything you can tweak (including what flags have been detected based on your VM configuration).