From cozy Java to brutal Native code or There and Back Again

Day 2 /  / Track 2  /  RU / Hardcore. Really hard and demanding talk, you'll understand only if you're an experienced engineer.

We all love Java and other managed languages but sometimes they're just not enough. Need access to the machine learning library, written on C? Or you just want to call the small method from OS API? Or (for just one of your modules!) you need to have a bit more performance than you can ever squeeze out of Java? Well, native code is your choice!

At first, it seems so simple and straightforward — you write a native method, load the native library, call the method and that's it, you are in native code! But then suddenly: JVM starts to crash in random places, performance drops significantly and your repository becomes flooded with the endless C files with so many J-N-I letters inside. At which exact moment something went so terribly wrong?

In this talk we will try to sort all things out: what is so unusual in the interop between Java and native code, and what history it has; how to work with native code right now to avoid segfaultы, performance drawdowns, sudden OOMs; and finally, what awaits us in the future with such projects as Panama and Sulong and will it make any sense to talk about interop when they arrived.

Download presentation


Ivan Ugliansky

Worked for Excelsior in Excelsior JET project (Java SE certified implementation based on optimizing AOT compilation). Now works for Huawei on JVMs, compilers and new programming languages. Basically, works with runtime: GC, class loading, concurrency maintenance, profiling and so on.

Also, he is co-founder and co-lead of JUGNsk — an official Java Users Group in Novosibirsk and Program Committee member of SnowOne conference.

In his free time teaches C/C++ courses at Novosibirsk State University.

Invited Experts

Andrei Kogun

Andrei has been working in IT for more than 15 years, head of the Java developers at KROK. During his career he took part in many custom development projects, mainly e-document flow systems and business processes automatization for several big Russian companies as a senior developer and an architect. At the universities of Moscow, he delivers lectures in development basics with the use of Java technologies. Organizer and leader of Moscow Java developers community.