My core plot graph consumes lot of memory. It crashes when I am plotting graph into a large frame. Every time I am recreating the graph by releasing graph object and it’s host view.
Also tried to remove plots added to the graph,
for(CPTPlot* plot in [graphByCorePlot_ allPlots]) {
plot.dataSource = nil;
plot.delegate = nil;
[plot deleteDataInIndexRange:NSMakeRange(0, plot.cachedDataCount)];
[graphByCorePlot_ removePlot:plot];
}
Is it enough to release all the memory allocated by core plot?
None of that should be necessary. You can update the graph by calling
-reloadDataon the graph to load new data for all plots. You can use the same method to update a single plot as well.When you’re done with the graph, remove it from the hosting view and release it if you have a retained reference to it.
If you’re still having memory problems, use Instruments to check for leaks.