Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor in LiveChart: Memory Leak and wrong tooltip #593

Open
MarcDahlem opened this issue May 8, 2021 · 1 comment
Open

Cursor in LiveChart: Memory Leak and wrong tooltip #593

MarcDahlem opened this issue May 8, 2021 · 1 comment

Comments

@MarcDahlem
Copy link

MarcDahlem commented May 8, 2021

How to reproduce:

  • Create an XYChart
    • XYChart chart = new XYChartBuilder().title("MemoryLeak").xAxisTitle("Date").yAxisTitle("Price").build();
  • Enable Cursor
    • chart.getStyler().setCursorEnabled(true);
  • Add some initial data to chart
    • XYSeries chartSeries = chart.addSeries("MemoryLeakSeries", dates, values);
  • Show the chart
    • SwingWrapper sw = new SwingWrapper(chart); sw.displayChart();
  • LiveChart: update the data from time to time
    • chart.updateXYSeries("MemoryLeakSeries", updatedDates, updatedValues, null);
  • Update the live chart
    • javax.swing.SwingUtilities.invokeLater(() -> sw.repaintChart());
  • ISSUE 1: Memory Leak: Wait some time and check memory
    • Result: grafik
  • ISSUE 2: Wrong cursor info: Check the cursor in the live chart. It shows wrong infos in the tooltip (one can see it at the timestamp. It doesnt match the updated legend. It changes sometimes backwards if the mouse is moved forward. It seems like the cursor data contains ALL elements of ALL Chart updates behind one another)
    • Wrong cursor infos:
      grafik
@shanescarlett
Copy link

Having the same symptoms as ISSUE 1 with a real time chart, gigabytes of org.knowm.xchart.internal.chartpart.Cursor$DataPoint held by dataPointList, it seems like. I think Cursor.java and the behaviour of the ArrayLists needs to be investigated.

stmuecke pushed a commit to stmuecke/XChart that referenced this issue Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants