Linux Javafx8graphics上的性能衰退问题

Linux Javafx8graphics上的性能衰退问题,第1张

概述Linux Javafx8graphics上的性能衰退问题

我在这里发现了几个有关windows和linux上的Javafx8graphics性能的点击,以及某些应用程序。 我已经尝试了-Dprism.vsync = false的build议,这似乎并没有影响结果。 我做了什么来消除它是我的代码的可能性是编写一个裸露的骨头air-gappable应用程序,只是给一个GraphicsContext2D宽度值为0和高度之间的随机高度值的数据。 当我让它在一夜之间运行时,我将尝试显示每个graphics周期的衰减metod调用时间,它是“

这确实工作得更好,但在windows上并不完美。 linux环境是Ubuntu 14.04当前。 Java是1.8.0_77。

我不知道的是这是Javafx8问题还是linux或linix X.Org问题。

windows EXE启动Java应用程序与JRE检查

使用Java 1.5打开文件的跨平台方法

Java创build可执行的cmd行程序(windows)

Java的100%cpu使用率

当我从本地Java方法抛出C ++exception时会发生什么?

-Dprism.verbose数据是:

Prism pipeline init order: es2 sw Using java-based Pisces rasterizer Using dirty region optimizations Not using texture mask for primitives Not forcing power of 2 sizes for textures Using harDWare CLAMP_TO_ZERO mode Opting in for hidpi pixel scaling Prism pipeline name = com.sun.prism.es2.ES2Pipeline Loading ES2 native library ... prism_es2 succeeded. GLFactory using com.sun.prism.es2.X11GLFactory (X) Got class = class com.sun.prism.es2.ES2Pipeline Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline Maximum supported texture size: 16384 Maximum texture size clamped to 4096 Non power of two texture support = true Maximum number of vertex attributes = 16 Maximum number of uniform vertex components = 16384 Maximum number of uniform fragment components = 16384 Maximum number of varying components = 128 Maximum number of texture units usable in a vertex shader = 16 Maximum number of texture units usable in a fragment shader = 16 Graphics vendor: X.Org Renderer: gallium 0.4 on AMD olAND Version: 3.0 Mesa 10.5.9 vsync: true vpipe: true ES2ResourceFactory: Prism - createStockShader: FillPgram_color.frag ES2ResourceFactory: Prism - createStockShader: SolID_TextureRGB.frag ES2ResourceFactory: Prism - createStockShader: SolID_color.frag ES2ResourceFactory: Prism - createStockShader: Mask_TextureSuper.frag new Alphas ES2ResourceFactory: Prism - createStockShader: Texture_color.frag ES2ResourceFactory: Prism - createStockShader: Texture_linearGradIEnt_PAD.frag ES2ResourceFactory: Prism - createStockShader: SolID_TextureFirstPassLCD.frag ES2ResourceFactory: Prism - createStockShader: SolID_TextureSecondPassLCD.frag new Alphas

在无数次的时间结束之后,我会用几分钟或几天的时间测量cpu(以jconsole或jvisualvm衡量),对于应用程序来说,从来就不会达到23%。 上方报告的cpu超过了50%。 最初的cpu是6%,在10分钟内稳步增加到23%左右,但是系统响应性非常好。 整个系统晚上或晚上过得可怜。 终止应用可能会locking整个系统一两分钟。 整个Java堆大小保持在50MB以下。 在GC上它下降到20年代。 我目前正在用X轴生成的graphics中,每隔100ms产生一个新的帧。 人们可以看到显示器中的呆板,在视觉上慢得多,但是我不知道生成时间是否不同。Y轴以uSec为单位,毫秒数certificate也是如此。 我已经意识到两件事情:1)Java9具有一个新的马林渲染器2)Ubuntu 16.04具有新的vIDeo驱动程序,AMD在这种情况下,我相信有内​​核的改进,以及涉及到graphics性能。 由于jvisualvm不会做lambdaExpression式,所以我做了一个堆转储,并在离线状态下查看,没有看到任何特别值得注意的地方。 我不相信在我的应用程序中放缓的来源。 我注意到Xorg运行在50%左右,并且在652K(652232)

在完整的应用程序不仅有一个示波器types的显示在顶部,但下面的瀑布(热图)。 我可以单独重现系统退化,但我想要一个足够小的应用程序来重现我所看到的,而无需额外的应用程序代码混淆问题。 同样,vsync的设置似乎没有任何影响。

现在根据顶端,它说,Java进程使用90%的cpu,而jvirtualvm说这个过程是使用22-23%,仍然是高的考虑它开始在6%。

今天上午(自从我昨天晚上写完这个以来)系统被完全locking,中断被禁止(没有数字locking或大写locking)。

在3.5小时的时间里,从上面看,java的cpu只有100%的低,cOrgg的缓慢增长。 现在是42%。 我的testing应用程序中的堆大约在13MB左右。 我不知道为什么它会从6%增长到23%(根据visualvm,但是按照top增长到100%左右),但visualvm显示了cpu和堆的平坦度。

任何意见,build议,知道什么可能是错误的,我的目标,或已经在pipe道治愈,将不胜感激。

谢谢,沃尔特

这驱动了显示器

ByteBuffer intBuffer = ByteBuffer.allocate(4); while (PanadapterVIEw.running) { short height = spectrumVIEw.getController().getHeight(); short wIDth = spectrumVIEw.getController().getWIDth(); try { Thread.sleep(100); if (height * wIDth != 0) { short data[] = new short[wIDth]; for (int i = 0; i < wIDth; i++) { data[i] = (short)(height - (Math.random()* height)); } milListart = System.nanoTime(); controller.onspectrumDataReady(null,data); millIDuration = (int)(System.nanoTime()-milListart); millIDuration += 500; millIDuration /=1000; intBuffer.asIntBuffer().put(millIDuration); if (output != null) { int written = output.write(intBuffer); } intBuffer.clear(); if (cnt++ % 5000 == 0) { if (output != null) { output.force(false); } } } } catch (InterruptedException | IOException ex) { PanadapterVIEw.running = false; } } if (output != null) { output.close(); }

}

这画canvas

public voID onspectrumDataReady(Panadapter targetPan,short[] data) { Platform.runLater(() -> { int start = 0; double offset = spectrum.getHeight(); double canvasWIDth = spectrum.getWIDth(); double canvasHeight = spectrum.getHeight(); assert (data.length == canvasWIDth); GraphicsContext gc = spectrum.getGraphicsContext2D(); gc.beginPath(); gc.clearRect(0,canvasWIDth,canvasHeight); // gc.save(); gc.setlinewidth(1); gc.setstroke(color.WHITESMOKE); gc.moveto(start,(double) data[0]); for (int i = start; i < data.length; i++) { gc.lineto((double) i,(double) data[i]); } gc.stroke(); // gc.closePath(); }); }

我刚刚停止了应用程序。 一旦我做了Xorg cpu下降到0.3%。 这里是图表,Y轴是美国的挂钟时间。

运行了7个半小时之后,以下内容表示绘制整个帧的挂钟持续时间。 我应该指出,以下代表了方法持续时间的1分钟滚动平均值。

我在windows 7上运行了相同的testing,并且在绘图中没有明显的缩小,这是缩小到prism.order = sw,因为没有selectes2和es1。 这个问题似乎是linux所独有的,无论是在JavaFX8渲染器还是在xorg本身。 其中,今天早上是在76%的cpu运行。

在linux中执行jar文件

一个.bat框架来启动Java程序

为什么Listfiles()在不同的平台上performance不同?

在windows 64位平台上可以安全使用的最大Java堆大小是多less?

如何在Java中创build(和读取)windows快捷方式(.lnk文件)?

总结

以上是内存溢出为你收集整理的Linux Javafx8graphics上的性能衰退问题全部内容,希望文章能够帮你解决Linux Javafx8graphics上的性能衰退问题所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1154955.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存