本文介绍了Linux上具有process = -1内存泄漏的JavaXF 8 ProgressBar和ProgressIndicator的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ProgressBar或ProgressIndicator进行设置为-1(INDETERMINATE_PROGRESS)的简单JavaFX应用程序的Java进度逐渐使用越来越多的内存,直到它在几分钟内填充ram和swap。

Java progress of simple JavaFX application with ProgressBar or ProgressIndicator which progress set to -1 (INDETERMINATE_PROGRESS) gradually uses more and more memory until it fills both ram and swap in just a few minutes.

我正在使用带有最新更新的Fedora 23 x86_64,kernel-4.4.5-300.fc23.x86_64和jdk1.8.0_74。 kernel-4.2.3-300.fc23.x86_64以及jdk1.8.0_73和jdk1.8.0_45都会出现同样的问题。

I'm using Fedora 23 x86_64 with latest updates, kernel-4.4.5-300.fc23.x86_64 and jdk1.8.0_74. The same problem occurs with kernel-4.2.3-300.fc23.x86_64 and both jdk1.8.0_73 and jdk1.8.0_45.

我遇到了这个问题我的项目即使在最简单的应用程序中也会出现:

I'm facing this problem in my project and it's occuring even in the simplest application:

package sample;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ProgressIndicator;
import javafx.stage.Stage;

public class ProgressBarMemoryLeak extends Application {

    ProgressIndicator progress = new ProgressIndicator(-1);

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setScene(new Scene(progress, 100, 100));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }

}

有没有办法克服这个问题问题?

Is there any way to overcome this problem?

也许我可以使用其他一些自定义ProgressBar实现?

Maybe there is some other custom ProgressBar implementation i can use instead?

推荐答案

记录此类问题的错误报告:

Log a bug report for such issues:



  • http://bugreport.java.com

添加对提交的错误报告的引用在这里,如果遇到这个问题,有人可以跟踪它。

Add a reference to the bug report filed here, so that somebody can track it if they run across this issue.

在此期间,不要在目标平台上使用不确定的进度。

In the meantime, don't use indeterminate progress on your target platform.

请注意,无论问题是什么,它都是特定于环境的(我无法在OS X上复制它)。

Note that whatever the issue is, it is environment specific (I cannot replicate it on OS X).

另请注意Fedora不是,但希望不会停止调查错误报告。

Also note that fedora is not a certified system configuration, but hopefully that won't stop the bug report being investigated.

这篇关于Linux上具有process = -1内存泄漏的JavaXF 8 ProgressBar和ProgressIndicator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 20:38