I have a problem with the java heap memory and the class DateTick, respectively.
First all TracePanelTimeSeries series are cleared (first code) and than new data is set into the series (second code).
My problem now is that if I do this for example the 3. or 4. time, the profiler show me, that a lot of DateTick- objects are created and I than get a java heap space- OutOfMemoryException.
I do not use the DateTick- class in my code.
What can I do, Is it not recommended to clear series and set data again into this series ?
Thanks a lot for your help,
All the best,
Code: Select all
@Override public void clearAllSeries() {
chart.removeChangeListener(trendZoomListener);
setLegendVisible(false);
for (Iterator<TracePanelTimeSeries> iterator = seriesList.iterator(); iterator.hasNext();) {
TracePanelTimeSeries seriesInList = iterator.next();
seriesInList.clear();
}
chart.addChangeListener(trendZoomListener);
}
Code: Select all
private void createDatasetWithExistingSerie(final TracePanelTimeSeries series, final String name, final RegularTimePeriod start, final List<DBWertReadBean> data, final int lineCnt, final TracePanelXYItemRenderer renderer, final String unit, final int lineIndex) {
for(DBWertReadBean element : data) {
int millis = element.getZeitstempel().getNanos()/(int)Math.pow(10, 6);
Millisecond ms = new Millisecond(millis, new Second(element.getZeitstempel()));
series.addOrUpdate(ms, element.getWert());
ms = null;
}
}