CPU使用率JavaFX [英] CPU Usage JavaFX

查看:369
本文介绍了CPU使用率JavaFX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用JFX应用程序时遇到了一些问题.在我的本地开发系统(Linux)上,我的应用程序的CPU使用率约为0-2%.当我在客户Windows vm系统上安装并运行我的应用程序时,CPU使用率要高得多,大约为50-70%.此现象仅在VM系统上发生.如果我在本地Windows系统上运行该应用程序,则一切运行正常.因此,我想这与vm图形适配器及其配置有关.但是客户说没有图形适配器配置可用. 我研究了类似的性能问题,并尝试了一些JVM选项,例如:

I got some problems by using JFX Applications. On my local developing system(Linux) my application got a cpu usage about 0-2%. When I install and run my application on the customer windows vm system, the cpu usage is much higher, about 50-70%. This phenomenon occurs only on a VM System. If i run the application on a local windows system everything runs fine. Therefore i guess it is related to the vm graphic adapter and his configuration. But the customer says there is no graphic adapter configuration available. I researched similar performance problems and I tried some JVM options like:

-Dprism.order=es2,es1,sw,j2d
-Dsun.java2d.opengl=true
-Dprism.vsync=false
-Dprism.forceGPU=true

-Dprism.order = es2,es1,sw,j2d选项将使用率降低了25%以下.仍然很高,但我不知道还能做什么?

The option -Dprism.order=es2,es1,sw,j2d reduced the usage under 25%. Still to high but i dont know what else can i do?

感谢您的答复.在运行不带-Dprism.order = es2,es1,sw,j2d的应用程序时,出现以下消息和70%的CPU使用率:

Thanks for the reply. When in run the app without -Dprism.order=es2,es1,sw,j2d i got follwoing message and 70% cpu usage:

D3DPipelineManager: Created D3D9Ex device Direct3D initialization succeeded (X) Got class = class com.sun.prism.d3d.D3DPipeline Initialized prism pipeline: com.sun.prism.d3d.D3DPipeline 

当我运行带有选项的应用程序时,出现以下消息和20%的CPU使用率:

When i run the app with the option i got following message and 20% cpu usage:

Prism pipeline name = com.sun.prism.sw.SWPipeline (X) Got class = class com.sun.prism.sw.SWPipeline Initialized prism pipeline: com.sun.prism.sw.SWPipeline 

推荐答案

根据

According to the JavaFX architecture, if the rendering engine cannot find suitable hardware accelerated pipeline, it falls back to software rendering, which is CPU intensive. Since it is a VM system that's having the issue, it is possible that either graphics drivers are not properly installed and/or outdated and/or not supported by JavaFX. Similar thing goes for DirectX libraries, as this is the technology JavaFX uses on Windows. Another thing to check would be if the VM configuration itself allows hardware acceleration (this is usually defined when the configuration is created).

因此,要采取的步骤:

  1. 检查VM配置
  2. 更新JDK
  3. 更新图形驱动程序(通常由VM软件提供商提供)
  4. 更新DirectX

这样做,您应该能够找出问题所在,或者至少缩小影响性能的因素

Having done that, you should be able to track down the issue, or at least narrow down things affecting the performance

这篇关于CPU使用率JavaFX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆