ReoGrid
ReoGrid copied to clipboard
Memory management needs improvements
I am trying to display around 10000 rows by 600 columns. Even through scrolling is completely smooth the memory consumption is around 1.4GB which is quite excessive. If I try loading more data, an OutOfMemory exception is thrown. In comparison, Excel takes around 20MB only for the same data.
I think this is because of the fact that ReoGrid stores every single cell in memory. There should be a way to enable Data Virtualization.
Related to this, the Excel export also does not work with large amount of data. It either gets stuck or throws an OutOfMemory exception.
Have you any suggestions to implement the memory management or Data Virtualization? sample code or PR would be great!
Have you any suggestions to implement the memory management or Data Virtualization? sample code or PR would be great!
I had the same problem,I think you can refer to datagridview .Let users draw cells themselves.
Or have an option to set, don't draw at once, draw again when needed
Or have an option to set, don't draw at once, draw again when needed
I think they load all and store all the cells in memory at once. They need to reuse existing cells with updated values and use some way of reading large files page by page. Some kind of compression will improve performance quite a bit as well.
I personally switched to the WinForms DataGrid and I keep compressed chunks of data in memory. I use their virtualization to open chunks and update to screen.
Virtualization feels like a must-have feature. I'm commenting on this to promote it a bit since it's been dormant a while now. If it was easy to implement I could try to take a stab at it, but my gut feeling is that it's not...
Thanks to everyone who has suggested this. I agreed with all of you.
I think this is a trade-off on what kind of grid component you want to be designed for.
Optimization for memory usage
Load cells when only be used; Always manage what cells to be loaded.
- Pros. Only current visible cells are loaded in memory.
- Cons. Scroll/Redraw might be slower since the management of loading cells spend more time.
Optimization for rendering performance
- Pros. Cache more information for cells in memory, get faster on rendering.
- Cons. Use more memory.
The current ReoGrid was designed more like the latter, because many of the features are dependent on cache, like styles, format, rendering status, especially the formulas, which need a dependency graph to determine the calculation chain.
Any more suggestions are welcome!