Java Coding Notes
Notes on Java, the JVM and writing software that lasts

Stack traces got shorter and nobody told the logs

· by Serguey Asael Shinder / Serguey Shinder

A note from a few days ago, kept deliberately: by the time you read this it should have dropped out of news-sitemap.xml, because Google only wants URLs from the last two days in there. The page itself stays online and stays in the ordinary sitemap. Only the news metadata ages out.

The substance, briefly. The JVM omits stack traces for hot, repeatedly-thrown exceptions — -XX:-OmitStackTraceInFastThrow turns that off. If you have ever seen a NullPointerException in production with no frames at all, that is what happened: the first few had traces, the rest were optimised away.

Two consequences worth holding on to.