JavaFX无法解释在Linux上泄漏内存 [英] JavaFX unexplainable leaks memory on Linux

查看:188
本文介绍了JavaFX无法解释在Linux上泄漏内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Java程序在Linux上独占运行时会泄漏内存。

My Java program leaks memory while operating on Linux exclusively.

症状:


  • VisualVM显示堆大小约为300Mb并且没有可疑活动。

  • 在Mac OS X上,程序无限期地运行900Mb内存(通过活动监视器)

  • 在Linux上,当操作系统内存不足时(通过活动监视器),内存占用空间迅速增加到4.5Gb

程序使用JavaFX。这种行为在提交后开始,将GUI和计算分成不同的线程。

The program uses JavaFX. This behaviour started after a commit which separated GUI and calculations into different threads.

这不能是JVM中的泄漏,可以吗?

This can't be a leak in the JVM, can it?

是否有任何工具可以调查此类问题?

Are there any tools to investigate such problems?

推荐答案

已报告各种内存泄漏错误反对JavaFX。它们与使用硬件加速图形有关。 头问题是:

Various memory leak bugs have been reported against JavaFX. They are related to use of hardware accelerated graphics. The "head" issue is this:

  • https://bugs.openjdk.java.net/browse/JDK-8161911

上面的评论表明这些错误可能在OpenGL实现中,但它们是由JavaFX正在做的事情触发的。您对提交的观察似乎很有说服力,可能值得向Oracle报告。

The comments on the above suggest that the bugs may be in the OpenGL implementation, but they are triggered by something JavaFX is doing. Your observation about your commit seems cogent, and it may be worth reporting this to Oracle.

另一方面,报告的错误与图形加速度相关的事实表明通过告诉Java不要使用图形加速,你可以解决你的问题。

On the other hand, the fact that the reported bugs are related to graphic acceleration suggests that you may be able to work around your problem by telling Java not to use graphics acceleration.


是否有调查此类问题的任何工具?

Are there any tools to investigate such problems?

我不知道。如果问题是人们认为的问题,那么最好的办法是解决它。

None that I know of. If the problem is where people think it is, then your best bet is to work around it.

这篇关于JavaFX无法解释在Linux上泄漏内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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