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

Day 1 /  / Track 3  /  RU /

We all love Java and other managed languages but sometimes they're just not enough. Need an 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 letter 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.

Ivan Ugliansky

Worked at Excelsior since 2011, was one of the Excelsior JET developers (Java SE certified implementation based on optimizing AOT compilation).

Basically, worked with runtime: GC, class loading, concurrency maintenance, profiling and so on. Besides, supported one plugin for the JET-compiled applications' debugging in GDB and sometimes wrote for Excelsior JET Team Blog.

Also, he is co-founder and co-lead of JUGNsk — an official Java Users Group in Novosibirsk, helps to organize meetups about Java and JVM.

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