corretto-8 icon indicating copy to clipboard operation
corretto-8 copied to clipboard

JavaFX UI hangs after being open overnight on Windows Server 2022 and Windows 11 machines

Open soumdev opened this issue 2 years ago • 3 comments

Describe the bug

JavaFX UI hangs after being open overnight on Windows Server 2022 machines

To Reproduce

Source Code:

import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.stage.Stage;

public class HelloWorld extends Application{

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

    @Override
    public void start(Stage stage) throws Exception {
    	
    	Button button = new Button("Click Me!");
    	HBox h = new HBox(button);
        h.setSpacing(20);
        
    	button.setOnMouseClicked(ev ->{
    		System.out.println("I've been clicked!");
    		button.setVisible(false);
    		h.getChildren().add(new Label("Hello World"));
    	});
        
		HBox.setMargin(h, new Insets(50));
	    Pane pane = new Pane(h);
	    
        stage.setScene(new Scene(pane));
        stage.setMinWidth(500);
        stage.setMinHeight(100);
        stage.show();
    }

}

Steps:

  1. Compile above code into a jar and run on a Windows Server 2022 using command line.
  2. Once UI pops up, click button on UI. The "Hello World" label is displayed. Console log shows "I've been clicked!"
  3. Close UI and open again using command line. Once the UI pops up, leave open overnight (or more than 12 hours).
  4. Click button on UI. UI hangs and label does not get displayed. Console log shows "I've been clicked!". Sometimes CPU usage spikes to more than 20% on clicking the button.

If you add an indeterminate progress indicator to the scene it would appear frozen after leaving the UI open overnight. CPU usage for the application remains high (more than 20%).

###Screenshots hello world not rendering

Expected behavior

Amazon Coretto 8 JavaFX UI should not hang after leaving it open overnight on Windows Server 2022 machines.

Platform information

OS: Windows Server 2022 Standard
   Version	21H2
   OS build	20348.469
Version:       openjdk version "1.8.0_322"
		OpenJDK Runtime Environment Corretto-8.322.06.1 (build 1.8.0_322-b06)
		OpenJDK 64-Bit Server VM Corretto-8.322.06.1 (build 25.322-b06, mixed mode)

soumdev avatar Feb 28 '22 18:02 soumdev

Thank you for reporting the issue. Do you know if this also happens on any other versions of Windows?

lutkerd avatar Feb 28 '22 18:02 lutkerd

Not that I know of, ours is a Windows desktop application and we've been using Corretto 8 without running into this issue on : Windows 7 Windows Server 2008 R2 Windows Small Business Server 2011 Windows 8 Windows 8.1 Windows 10 Windows Server 2012 Windows Server 2012 R2 Windows Server 2016 Windows Server 2019

soumdev avatar Feb 28 '22 22:02 soumdev

Thank you for reporting the issue. Do you know if this also happens on any other versions of Windows?

This is also happening on Windows 11.

soumdev avatar Mar 24 '22 06:03 soumdev