Community
Participate
Working Groups
Build Identifier: I20100608-0911 It is possible to create the Grid with the VIRTUAL flag. But it will probably not be considered. As a result I get an OutOfMemoryError. Reproducible: Always Steps to Reproduce: I prepared the GridSnippet1 code to reproduce this issue: public class GridSnippet1 { public static void main( String[] args ) { Display display = new Display(); Shell shell = new Shell( display ); shell.setLayout( new FillLayout() ); Grid grid = new Grid( shell, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL ); grid.setHeaderVisible( true ); GridColumn column = new GridColumn( grid, SWT.NONE ); column.setTree( true ); column.setText( "Column 1" ); column.setWidth( 100 ); GridItem item1 = new GridItem( grid, SWT.NONE ); item1.setText( "Root Item" ); GridItem item2 = new GridItem( item1, SWT.NONE ); item2.setText( "Second item" ); GridItem item3 = new GridItem( item2, SWT.NONE ); item3.setText( "Third Item" ); grid.setItemCount( 1000000 ); shell.setSize( 200, 200 ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) display.sleep(); } display.dispose(); } }
Patch https://bugs.eclipse.org/bugs/show_bug.cgi?id=385300 avoid OOM in creation phase. Please see GridVirtualTableViewer.java snippet.