Skip to main content

Java native launcher performance


I have a program written in Java and a native launcher written in C++, based on a sample at http://www.codeproject.com/Articles/17352/JVM-Launcher . A strange thing is that running my program with my native launcher take more CPU than using java.exe (~5% vs 15-20%). I have been giving this situation some thought but it still doesn't make much sense. I've tried increasing the JVM heap size, (re)built the native launcher in release mode, used different JRE version(1.6_24, 1.6_31, 1.7_03) but no luck.



Does anybody have a suggestion for how to fix this?


Source: Tips4allCCNA FINAL EXAM

Comments

  1. Note: Providing this answer to move the OP's comment to answer.

    The problem was that the C++ program was running the native launcher with the -Djava.compiler=NONE setting, which essentially set the JVM to run in "interpretive" mode, disabling JIT (just-in-time) compilation of java bytecode to native code, which naturally makes run slower as the bytecode needs to be interpreted every time it is executed.

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?