Load model in Scala works, but predict failed

I tried to use scala interface (and I use kotlin as my programming language) to load and predict insightface model(since all my project is programmed by kotlin, I try to use only one language in my project, that will make my deployment easily), but it failed. I tried to debug one statement by one statement, even every parameter which pass to the C API is same, but Python works well but Scala API throw out an Error (std:alloc_err).

The code I published here https://github.com/mikeshi80/insightface-kotlin, any help is welcomed.

Thank you for your attention.