constellation-app / constellation

A graph-focused data visualisation and interactive analysis application.
https://constellation-app.com
Apache License 2.0
386 stars 58 forks source link

Application Freezing when Exporting Graph as SVG #2115

Open capricornunicorn123 opened 3 months ago

capricornunicorn123 commented 3 months ago

Prerequisites

Description

When exporting to SVG, users are presented with the option to select the number of processors that they would like to dedicate to the export. Currently users can dedicate all of their processors to the export if they choose meaning that the application has to fight for time on these processors to continue to run the UI and background functions.

Steps to Reproduce

  1. Export a graph with 20000 nodes to an SVG file.
  2. Increase the number of available processors to the maximum value
  3. Interact with the application whilst exporting and watch for UI issues.

Expected behaviour: Limit the number of processors available to the SVGExportPlugin to ensure some a free for the application

Actual behaviour: users can dedicate all processors to the export

Reproduces how often: whenever the users choose to increase the number of available processors

Additional Information

The issue can easily be fixed by amending the maximum number of processors available for the export in the file au.gov.asd.tac.constellation.plugins.importexport.svg.SVGExportPlugin.Java

IntegerParameterType.setMinimum(exportCores, 1);
IntegerParameterType.setMaximum(exportCores, Runtime.getRuntime().availableProcessors());

The trick will be to determine how many processors should be left for the application.