Home » Eclipse Projects » Remote Application Platform (RAP) » Trees and memory problems on IE 7
Trees and memory problems on IE 7 [message #124004] |
Mon, 09 March 2009 14:43 |
Enrico Zanaga Messages: 50 Registered: July 2009 |
Member |
|
|
Hi,
in IE 7 the Tree widget is much memory expensive.
When started with an empty shell, IE 7 consumes about 55M of memory.
A tree with 1000 elements consumes about 480M.
A tree with SWT.VIRTUAl style, also with 1000 elements, initially
consumes 375M, but scrolling the tree from first to last item the memory
goes up to 790M.
Firefox 3.0 with an empty shell is 70M, with a tree with 1000 elements
is 147M, and a tree with SWT.VIRTUAl with 1000 elements is 162M.
In my application I often use a tree with many root nodes and child
nodes, and with this memory consumption IE is unusable.
I wish to know if is there any solution in progress? The next version of
Qooxdoo can give some improvements?
Here's the normal snippet:
public class TreeTestNormal implements IEntryPoint {
private Display d;
private Shell s;
private Tree t;
@Override
public int createUI() {
d = new Display();
s = new Shell(d);
s.setBounds(0, 0, 800, 600);
s.setLayout(new FillLayout());
t = new Tree(s, SWT.BORDER | SWT.SINGLE);
t.setHeaderVisible(true);
for( int i = 0; i < 3; i++ ) {
TreeColumn tc = new TreeColumn(t, SWT.LEFT, i);
tc.setText(String.valueOf(i));
tc.setWidth(100);
}
for( int y = 0; y < 1000; y++ ) {
TreeItem ti = new TreeItem(t, SWT.LEFT, y);
String s = String.valueOf(y);
ti.setText(s);
ti.setText(1, s);
ti.setText(2, s);
}
s.open();
while( !s.isDisposed() )
if( !d.readAndDispatch() )
d.sleep();
d.dispose();
return 0;
}
}
Here's the "virtual" snippet:
public class TreeTestVirtual implements IEntryPoint {
private Display d;
private Shell s;
private Tree t;
@Override
public int createUI() {
d = new Display();
s = new Shell(d);
s.setBounds(0, 0, 800, 600);
s.setLayout(new FillLayout());
t = new Tree(s, SWT.BORDER | SWT.SINGLE | SWT.VIRTUAL);
t.setHeaderVisible(true);
for( int i = 0; i < 3; i++ ) {
TreeColumn tc = new TreeColumn(t, SWT.LEFT, i);
tc.setText(String.valueOf(i));
tc.setWidth(100);
}
t.addListener(SWT.SetData, new Listener() {
@Override
public void handleEvent(Event event) {
TreeItem ti = (TreeItem)event.item;
TreeItem pi = ti.getParentItem();
int y = event.index;
String s = String.valueOf(y);
ti.setText(s);
ti.setText(1, s);
ti.setText(2, s);
}
});
t.setItemCount(1000);
s.open();
while( !s.isDisposed() )
if( !d.readAndDispatch() )
d.sleep();
d.dispose();
return 0;
}
}
Thanks
Enrico
|
|
|
Re: Trees and memory problems on IE 7 [message #124043 is a reply to message #124004] |
Mon, 09 March 2009 15:51 |
Enrico Zanaga Messages: 50 Registered: July 2009 |
Member |
|
|
Hi,
I see that a table doesn't load all elements, but loads only visible
elements and on scrolling replaces the text in the cells.
A tree instead loads all elements the first time.
Is it possible to use the same logic of table also for the tree?
Enrico Zanaga ha scritto:
> Hi,
>
> in IE 7 the Tree widget is much memory expensive.
> When started with an empty shell, IE 7 consumes about 55M of memory.
> A tree with 1000 elements consumes about 480M.
> A tree with SWT.VIRTUAl style, also with 1000 elements, initially
> consumes 375M, but scrolling the tree from first to last item the memory
> goes up to 790M.
>
> Firefox 3.0 with an empty shell is 70M, with a tree with 1000 elements
> is 147M, and a tree with SWT.VIRTUAl with 1000 elements is 162M.
>
> In my application I often use a tree with many root nodes and child
> nodes, and with this memory consumption IE is unusable.
>
> I wish to know if is there any solution in progress? The next version of
> Qooxdoo can give some improvements?
>
>
> Here's the normal snippet:
>
> public class TreeTestNormal implements IEntryPoint {
> private Display d;
> private Shell s;
> private Tree t;
>
> @Override
> public int createUI() {
> d = new Display();
> s = new Shell(d);
> s.setBounds(0, 0, 800, 600);
> s.setLayout(new FillLayout());
>
> t = new Tree(s, SWT.BORDER | SWT.SINGLE);
> t.setHeaderVisible(true);
>
> for( int i = 0; i < 3; i++ ) {
> TreeColumn tc = new TreeColumn(t, SWT.LEFT, i);
> tc.setText(String.valueOf(i));
> tc.setWidth(100);
> }
>
> for( int y = 0; y < 1000; y++ ) {
> TreeItem ti = new TreeItem(t, SWT.LEFT, y);
> String s = String.valueOf(y);
> ti.setText(s);
> ti.setText(1, s);
> ti.setText(2, s);
> }
>
> s.open();
> while( !s.isDisposed() )
> if( !d.readAndDispatch() )
> d.sleep();
> d.dispose();
> return 0;
> }
> }
>
>
> Here's the "virtual" snippet:
>
> public class TreeTestVirtual implements IEntryPoint {
> private Display d;
> private Shell s;
> private Tree t;
>
> @Override
> public int createUI() {
> d = new Display();
> s = new Shell(d);
> s.setBounds(0, 0, 800, 600);
> s.setLayout(new FillLayout());
>
> t = new Tree(s, SWT.BORDER | SWT.SINGLE | SWT.VIRTUAL);
> t.setHeaderVisible(true);
>
> for( int i = 0; i < 3; i++ ) {
> TreeColumn tc = new TreeColumn(t, SWT.LEFT, i);
> tc.setText(String.valueOf(i));
> tc.setWidth(100);
> }
>
> t.addListener(SWT.SetData, new Listener() {
> @Override
> public void handleEvent(Event event) {
> TreeItem ti = (TreeItem)event.item;
> TreeItem pi = ti.getParentItem();
> int y = event.index;
>
> String s = String.valueOf(y);
> ti.setText(s);
> ti.setText(1, s);
> ti.setText(2, s);
> }
> });
> t.setItemCount(1000);
>
> s.open();
>
> while( !s.isDisposed() )
> if( !d.readAndDispatch() )
> d.sleep();
> d.dispose();
>
> return 0;
> }
> }
>
>
> Thanks
> Enrico
|
|
|
Goto Forum:
Current Time: Wed Apr 24 22:08:07 GMT 2024
Powered by FUDForum. Page generated in 0.05444 seconds
|