Category: java

  • Recording test performance with Jenkins

    In many (most?) systems performance is an important non-functional requirement. And even if you attained the required performance, it is useful to keep an eye on it to detect if a codechange involuntarily deteriorates it. Enter the Performance plugin for Jenkins. Using it you can record the performance (as in: speed of execution) of your…

  • Running JRuby on 64 bit Windows

    Usually it is as simple as: download, install, run. You can run into problems however if you have both the 32 bit and 64 bit JVMs installed (which is quite often) because it will try to use the 32 bit JVM. You can check which JVM is being used from the command line: jruby –version…

  • Adding tab completition to Maven3 under Ubuntu

    Maven 3 was released recently (depending on your definition of recent), but is not yet packaged for Ubuntu. This is generally not a problem, since the installation instructions are easy to follow (alternatively here are the installation instructions from the Sonatype maven book), but you don’t get tab completion in your terminal, which is quite…

  • Setting the maximum number of opened files under Ubuntu (for JProfiler)

    As I found out “on my own skin”, setting fs.file-max in /etc/sysctl.conf is a BAD idea. It can render your system useless in one step. Please don’t do it! If you did it, use the recovery mode to roll back the change. Also, currently I would only recommend doubling the limit (ie going from 1024…

  • DiskMap – an disk backed Map in Java

    I have the following problem: a Java application was running out of memory. It was not feasible to mandate 64 bit JVM for this application and the ~1.4G limit wasn’t enough. My solution was to implement a Map which – when an element is added – also saves the value to disk and only holds…

  • Microbenchmarking and you

    Crossposted from the Transylvania JUG website. Microbenchmarking is the practice of measuring the performance characteristics (like CPU, memory or I/O) of a small piece of code to determine which would be better suited for a particular scenario. If I could offer but one advice on this, it would be this: don’t. It is too easy…

  • Is hand-writing assembly still necessary these days?

    Some time ago I came over the following article: Fast CRC32 in Assembly. It claimed that the assembly implementation was faster than the one implemented in C. Performance was always something I’m interested in, so I repeated and extended the experiment. Here are the numbers I got. This is on a Core 2 Duo T5500…

  • Augmenting Log4J stack traces with class versions

    If you have multiple versions of your code in production, it is extremely useful for the log to include the version of the classes when producing a stacktrace, otherwise it is very hard to match the lines in the stacktrace with the lines of the source code (sidenote: there is an optimization in the Sun…

  • Remote debugging with Java

    Sometimes you have the situation that an issue is only occurring on certain machines or only at a certain time of day. There are a couple of possible methods to investigate such an issue (like: adding extra logging), however I would like to add an other one: remote debugging trough TCP/IP. To do this, start…

  • Navigating (Searching) Collections

    Update: this article has been crossposted to the Transylvania JUG blog. The Java collections framework includes the concept of NavigableSets / NavigableMaps. The principle behind these interfaces is that taking a SortedSet/SortedMap you can use a subset of it. Some examples: Given the following set: @Before public void setUp() { set = new TreeSet(); set.addAll(Arrays.asList(1,…