1. 10

Hi! This is a small post I wrote a couple days ago about how I learnt that the JVM uses SIGSEGVs and other “deadly” signals for some interesting purposes and thought it could be interesting to share it here :). I’m not an expert in the topic at all and would love to learn more about other interesting or surprising programming languages implementation details. Cheers :)

  1. 3

    I knew it used SEGV for NPE’s. Had no idea it used them for regular if (x == null) comparisons, though!

    Is there any way for HotSpot to detect, or be told, when this optimization might be making the app slower? Many defensive null checks are in cold code, but there’s also plenty of Java code that actively expects a parameter to be null most of the time, and it would be a bad idea to fault into the OS every time in an expected branch.