-
Notifications
You must be signed in to change notification settings - Fork 664
A memory surge issue #589
Copy link
Copy link
Open
Description
I'm not sure if this is a known issue, when I use ImPlot:: PlotLine to plot 80000 static points and display them all, for example:
static std::vector<float> plot_y(80000, 0);
if (ImPlot::BeginPlot(u8"test_plot1", u8"index", u8"val", ImVec2(-1, -1), ImPlotFlags_NoLegend | ImPlotFlags_NoTitle | ImPlotFlags_NoMouseText))
{
ImPlot::SetupAxis(ImAxis_Y1, u8"val", ImPlotAxisFlags_AutoFit);
ImPlot::SetupAxisLimits(ImAxis_X1, 0, 80000, ImGuiCond_Always);
ImPlot::PlotLine("plot2", plot_y.data(), 80000);
ImPlot::EndPlot();
}
The memory usage only increased by 25MB, which is basically normal. But when switching to dynamically drawing 80000 points, the memory usage will increase by more than 1000 MB, for example:
static std::vector<float> plot_y(80000, 0);
static int plot_show_points = 0;
plot_show_points += 200;
if (plot_show_points > 80000)
plot_show_points = 0;
if (ImPlot::BeginPlot(u8"test_plot1", u8"index", u8"val", ImVec2(-1, -1), ImPlotFlags_NoLegend | ImPlotFlags_NoTitle | ImPlotFlags_NoMouseText))
{
ImPlot::SetupAxis(ImAxis_Y1, u8"val", ImPlotAxisFlags_AutoFit);
ImPlot::SetupAxisLimits(ImAxis_X1, 0, plot_points, ImGuiCond_Always);
ImPlot::PlotLine("plot2", plot_y.data(), plot_show_points);
ImPlot::EndPlot();
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels