Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Memory leak

    Hi.

    I have a memory leak in my application. It's leaks for about 2Mb per minute.
    Can somebody give some advice how I can avoid this?

    Here is a test case:

    SmartClient Version: 8.1/LGPL Development Only (built 2010-06-19)
    GWT 2.0.3
    Windows XP SP3 IE7/8

    Code:
    public class TestCase implements EntryPoint {
    
    	private class Fetcher extends Timer {
    		private ListGrid grid;
    
    		public Fetcher(ListGrid grid) {
    			this.grid = grid;
    		}
    
    		public void run() {
    			grid.invalidateCache();
    		}
    	}
    
    	private void test() {
    		;//NOP
    	}
    
    	public void onModuleLoad() {
    		final ListGrid grid = new ListGrid();
    		RestDataSource tableDataSource = new RestDataSource();
    		tableDataSource.setDataURL(Configuration.webService + "TestData");
    		tableDataSource.setDataFormat(DSDataFormat.JSON);
    
    		OperationBinding fetch = new OperationBinding();
    		fetch.setOperationType(DSOperationType.FETCH);
    		fetch.setDataProtocol(DSProtocol.POSTMESSAGE);
    		tableDataSource.setOperationBindings(fetch);
    		
    		DSRequest request = new DSRequest();
    		request.setUseSimpleHttp(true);
    		tableDataSource.setRequestProperties(request);
    
    		tableDataSource.addField(new DataSourceTextField("Col0"));
    		tableDataSource.addField(new DataSourceTextField("Col1"));
    		tableDataSource.addField(new DataSourceTextField("Col2"));
    		tableDataSource.addField(new DataSourceTextField("Col3"));
    		tableDataSource.addField(new DataSourceTextField("Col4"));
    		grid.setDataSource(tableDataSource);
    
    		grid.setAutoFetchData(true);
    		grid.setShowRollOver(false);
    		grid.setWidth100();
    		grid.setHeight100();
    
    		grid.addDataArrivedHandler(new DataArrivedHandler() {
    			public void onDataArrived(DataArrivedEvent event) {
    				test();
    			}
    		});
    
    		VLayout layout = new VLayout();
    		layout.setHeight100();
    		layout.setWidth100();
    		layout.addMember(grid);
    
    		Canvas screen = new Canvas();
    		screen.setHeight100();
    		screen.setWidth100();
    		screen.addChild(layout);
    		screen.draw();
    
    		Fetcher fetcher = new Fetcher(grid);
    		fetcher.scheduleRepeating(2000);
    	}
    }
    Without DataArrivedHandler it's not leaking...

    Thanks, and sorry for my english =)

    #2
    Please, somebody.

    Comment


      #3
      I don't understand, no one has memory leaks?

      I tryed the same with SmartGWT 2.2 release and, unfortunately, I have the same leaks...

      What I'm doing wrong?

      I would be glad to any advice.

      Comment

      Working...
      X