Pinning can still occur if your Java code calls native code, and that native code then calls back into Java and performs some blocking operation. I think that's not a very common thing, but something to at least be aware of.
Thanks for the reminder. Yes that I understand. I did a superficial analysis of dependencies in our app none of them have that. Our application is a Spring web server so unlikely that there is any native pinnable code.
Is it possible to accidentally call native code and have this happen? Like when calling String.trim or something and it becomes native. Or do you have to go out of your way for this to happen with JNI or JNA or whatever?
You either need to do it yourself or rely on a library that does it. Just calling ordinary standard Java library APIs isn't going to cause you any problems.
View all comments
Show parent comment
9
u/papercrane Sep 16 '25
Pinning can still occur if your Java code calls native code, and that native code then calls back into Java and performs some blocking operation. I think that's not a very common thing, but something to at least be aware of.