I am using the Apache Java WicketStuff InMethod grid and was wanting the grid to automatically refresh its contents at 1 second intervals – the window can stay open for several hours at a time. So I attached an AjaxSelfUpdatingTimerBehaviour to the grid as shown below. The grid does indeed update correctly however after some time (~15mins) Google Chrome crashes with an “out of memory” exception. Profiling the browser does indeed show the Chrome tab memory growing incrementally with each update (like a leak).
Is this expected behaviour? Am I misusing the Ajax functionality here? Should I be using something else (WebSockets?) for this use case?
I experimented with adding some HTML meta refresh to force a page refresh every 2 mins but this workaround really smells to me..
Thanks in advance
import com.inmethod.grid.IDataSource;
import com.inmethod.grid.datagrid.DataGrid;
import com.inmethod.grid.datagrid.DefaultDataGrid;
DataGrid<IDataSource<MyRow>, MyRow, String> myGrid = new DefaultDataGrid<IDataSource<MyRow>, MyRow, String>("myGrid", myDataSource,myColumns);
myGrid.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(1)));
S D is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.