Hi,

I'm having some difficulties when making multiple GWT RPC calls from
within a GWT Timer.

I've run my example in a few different applications that monitor the
memory usage of the page and in all of them there is a constant
increase in the amount of memory after each call.

In the example all I am doing is scheduling a Timer to run every 5
seconds to call my service that simply returns a large string - around
250,000 characters (JSON formatted).

The memory increase seems to occur in IE7, IE8, FireFox & Chrome.
Chrome's developer tools (Heap Snapshots profile) seems to suggest
that the increase is related to the strings I'm returning - I'm
assuming that by nulling the string that once the method finishes
running the garbage collector should clean it up but something must be
holding onto them, I just cant work out what!!

Any help would be greatly appreciated! Let me know if anyone requires
any extra information!


My entry point consists of the following code.

package com.imass.performancetesting.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;

import com.imass.performancetesting.client.services.IVesselServices;
import
com.imass.performancetesting.client.services.IVesselServicesAsync;

public class PerformanceTestingEntryPoint implements EntryPoint {

        /**
         * Create a remote service proxy to talk to the server-side Vessel
service (Async).
         */
        private IVesselServicesAsync rpcVesselServices =
GWT.create(IVesselServices.class);

        public void onModuleLoad() {

                new Timer() {
                        public void run() {
                                rpcVesselServices.getCurrentVessels(new 
AsyncCallback<String>() {
                                        @Override
                                        public void onFailure(Throwable arg0) {
                                                // Show the RPC error message 
to the user
                                                GWT.log(arg0.getMessage());
                                        }
                                        @Override
                                        public void onSuccess(String 
resultString) {
                                                resultString = null;
                                        }
                                });
                        }
                }.scheduleRepeating(5 * 1000);

        }

}


Thanks in advance,
Jason.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to