开发者

Advantages of using JNA over process execution

开发者 https://www.devze.com 2022-12-20 20:22 出处:网络
I have a project that currently executes many external programs using java.lang.Process. Assuming that their functionality is also available in native library form, what would be the advan开发者_开发知

I have a project that currently executes many external programs using java.lang.Process. Assuming that their functionality is also available in native library form, what would be the advan开发者_开发知识库tages of executing said library functions using JNA instead?

The process executions are fairly heavy - they take a few seconds to complete. Am I correct in thinking that performance gains would be minimal?


You might find this helpful: Execute native code via JNI/DLL or EXE?

We went with native execution. As per the accepted answer, there is less risk of memory leaks and it's easy to restart the native process as needed.

0

精彩评论

暂无评论...
验证码 换一张
取 消