mardi 14 juin 2016

Java Application Uses Relatively More CPU On Better PC Than Laptop

I've got a tough question. I have a PC with a i5-3470 processor and a laptop with a i5-5200U processor. Naturally the 3470 cpu (which is in my desktop) is a lot faster, even when used single-core (see http://cpu.userbenchmark.com/Compare/Intel-Core-i5-5200U-vs-Intel-Core-i5-3470/m22169vs2771). Yet for some reason when running the same java program on my PC requires more % of the cpu (when reading values from taskmanager) than my laptop (which has the 5200U processor).

Now I am not quite sure what the cause for this is. Where the program (which is an audioplayer that uses JavaFX's mediaplayer class to play audio) runs at an average of 0.4% cpu on my laptop with peaks reaching up to 1%, it runs at 0.5% on my PC with peaks reaching up to 1.8%. This obviously does not sound like a massive difference, but looking at both processor's specifications this is very unexpected behaviour. I'll list a bunch of facts to help you folks diagnose why this is happening:

-Both systems have the exact same java version

-Both systems use the exact same JVM options (see below)

-Both systems use the exact same program & .jar file

-Launching it from Netbeans IDE or outside of Netbeans IDE does not matter

-Both systems have very identical system properties as far as visible (see below)

-The PC also uses slightly more RAM (about 3mb more RAM) which might be caused by a certain system property. This piece of code gets called when the program launches: System.setProperty("sun.java2d.noddraw", "true"); which is a java system property that on some systems saves about 5mb of RAM.

Could you guys please help me figure out why the CPU usage is high on my PC with the i5 3470 compared to the laptop with the 5200U? Does it have to do with some system properties that are not visible on the list below, but that are activated on the one system and not on the other? Or are there other causes? Much thanks for the help in advance.

Why this matters

The program is supposed to be running at a very low profile, for experimental reasons. The difference in cpu time is also visible on PerfMon which is quite a bit more accurate than taskmanager. You'd expect the program to run at near 0.1% on the 3470 processor, which it doesnt.

JVM options:

-Xmaxjitcodesize2500k -XX:MaxPermSize=7m -XX:MinHeapFreeRatio=3 -XX:MaxHeapFreeRatio=7 -Xms5m -Xmx130m -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled

Relevant System Properties:

java.awt.graphicsenv: sun.awt.Win32GraphicsEnvironment

os.arch: amd64

os.name: Windows 8.1

sun.java2d.noddraw: true

sun.jnu.encoding: Cp1252

java.library.path: C:Program FilesJavajdk1.8.0_77jrebin;C:Windows SunJavabin;C:Windowssystem32;C:Windows;C:ProgramDataOracle Javajavapath;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:Windowssystem32;C:Windows;C:WindowsSystem32 Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program FilesIntel Intel(R) Management Engine ComponentsDAL;C:Program Files (x86)Intel Intel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program FilesIntelWiFibin;C:Program FilesCommon FilesIntelWirelessCommon;C:Program Files (x86)SkypePhone;

sun.management.compiler: HotSpot 64-Bit Tiered Compilers

java.awt.printerjob: sun.awt.windows.WPrinterJob

file.encoding: UTF-8

sun.arch.data.model: 64

awt.toolkit: sun.awt.windows.WToolkit

java.vm.info: mixed mode

sun.io.unicode.encoding: UnicodeLittle

sun.cpu.endian: little

sun.desktop: windows

sun.cpu.isalist: amd64

Aucun commentaire:

Enregistrer un commentaire