Major memory leak with RPC, Internet Explorer and GWT 2.0 (MS1 & MS2)

220 views
Skip to first unread message

Rob

unread,
Nov 13, 2009, 9:18:49 AM11/13/09
to Google Web Toolkit
I've been trying out one of my existing apps with GWT 2.0 to see what
advantages it has and have noticed a major memory leak when using RPC
with Internet Explorer 8.0.

Basically my application reads some values from a database and
displays these in the browser every 1 second. I am seeing a memory
leak of 16k per second - i.e. every time I make an RPC request the
browser leaks 16k of memory. This eventually leads to an out of
virtual memory system error. If I switch back to using GWT 1.7 then
the problem goes away, there are no leaks at all.

I have managed to reproduce the problem with a very simple RPC example
which I can supply if required.

Has anyone else noticed anything similar ?

Cheers
Rob

Rob

unread,
Nov 14, 2009, 11:28:01 AM11/14/09
to Google Web Toolkit
See http://code.google.com/p/google-web-toolkit/issues/detail?id=4133
and http://code.google.com/p/google-web-toolkit/issues/detail?id=4229

Issue 4133 was raised almost a month ago but doesn't seem to have been
acknowledged yet - would anyone from the GWT team care to comment ?

Cheers
Rob

Ian Bambury

unread,
Nov 14, 2009, 12:12:18 PM11/14/09
to google-we...@googlegroups.com
There are over 100 issues that are still 'New' which were reported 2 years ago or more.


2009/11/14 Rob <rob.a...@gmail.com>

Backslash

unread,
Nov 13, 2009, 3:21:00 PM11/13/09
to Google Web Toolkit

mrpantsuit

unread,
Dec 3, 2009, 11:35:29 AM12/3/09
to Google Web Toolkit
I'm seeing a similar memory leak in 1.7. Does anyone know if this bug
predated 2.0, or was it introduced therein?

On Nov 14, 11:28 am, Rob <rob.a.st...@gmail.com> wrote:
> Seehttp://code.google.com/p/google-web-toolkit/issues/detail?id=4133
> andhttp://code.google.com/p/google-web-toolkit/issues/detail?id=4229
>
> Issue 4133 was raised almost a month ago but doesn't seem to have been
> acknowledged yet - would anyone from the GWT team care to comment ?
>
> Cheers
> Rob
>
> On Nov 13, 2:18 pm, Rob <rob.a.st...@gmail.com> wrote:
>
>
>
> > I've been trying out one of my existing apps with GWT 2.0 to see what
> > advantages it has and have noticed a majormemoryleakwhen using RPC
> > with Internet Explorer 8.0.
>
> > Basically my application reads some values from a database and
> > displays these in the browser every 1 second. I am seeing amemory
> >leakof 16k per second -i.e.every time I make an RPC request the
> > browser leaks 16k ofmemory. This eventually leads to an out of
> > virtualmemorysystem error. If I switch back to using GWT 1.7 then

Chris Ramsdale

unread,
Dec 3, 2009, 11:59:51 AM12/3/09
to google-we...@googlegroups.com
A diff on com.google.gwt.xhr.client.XMLHttpRequest should give you an idea of what code has changed and when it changed. That said, Rob points out earlier in this thread that he is not seeing the issue in 1.7. 

Are you in a position where you could build your app with RC2 to see if the leak goes away?

--

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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



mrpantsuit

unread,
Dec 4, 2009, 2:41:34 PM12/4/09
to Google Web Toolkit
I downloaded the Developer Channel version of Chrome, which has some
nice heap analysis developer tools. I thought that perhaps my memory
leaks were not restricted to IE, but were simply more pronounced on
it. Turns out I had several memory leaks.

I changed to use the GWT incubator progress bar instead of the GWT Ext
one, which seemed to reduce the IE leakage significantly. I don't
know the leak is inherent to the GWT Ext progress bar, or perhaps I
was just using it wrong.

I also noticed that I was leaking XMLHttpRequests. I rebuilt with GWT
2.0 RC2, but the leak persisted. I'm still investigating that one.

I was also leaking HTTPCollections. I have a FlexTable that I rebuild
every few seconds after RPCing data from the server. I'm still
investigating that one, too.

Thanks,
Kevin

On Dec 3, 11:59 am, Chris Ramsdale <cramsd...@google.com> wrote:
> A diff on com.google.gwt.xhr.client.XMLHttpRequest should give you an idea
> of what code has changed and when it changed. That said, Rob points out
> earlier in this thread that he is not seeing the issue in 1.7.
>
> Are you in a position where you could build your app with RC2 to see if the
> leak goes away?
>
> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com>
> > .

mrpantsuit

unread,
Dec 4, 2009, 3:32:01 PM12/4/09
to Google Web Toolkit
Regarding the XMLHttpRequest leak, it seems I just need to wait for
the garbage collector to run. Does anyone know how to manually
initiate garbage collection in Chrome (or in the other browsers, for
that matter)?

On Dec 4, 2:41 pm, mrpantsuit <kevin.peter.w...@gmail.com> wrote:
> I downloaded the Developer Channel version of Chrome, which has some
> nice heap analysis developer tools.  I thought that perhaps my memory
> leaks were not restricted to IE, but were simply more pronounced on
> it.  Turns out I had several memory leaks.
>
> I changed to use the GWT incubator progress bar instead of the GWT Ext
> one, which seemed to reduce the IE leakage significantly.  I don't
> know theleakis inherent to the GWT Ext progress bar, or perhaps I
> was just using it wrong.
>
> I also noticed that I was leaking XMLHttpRequests.  I rebuilt with GWT
> 2.0 RC2, but theleakpersisted.  I'm still investigating that one.
>
> I was also leaking HTTPCollections.  I have a FlexTable that I rebuild
> every few seconds after RPCing data from the server.  I'm still
> investigating that one, too.
>
> Thanks,
> Kevin
>
> On Dec 3, 11:59 am, Chris Ramsdale <cramsd...@google.com> wrote:
>
>
>
> > A diff on com.google.gwt.xhr.client.XMLHttpRequestshould give you an idea
> > of what code has changed and when it changed. That said, Rob points out
> > earlier in this thread that he is not seeing the issue in 1.7.
>
> > Are you in a position where you could build your app with RC2 to see if the
> >leakgoes away?
>
> > On Thu, Dec 3, 2009 at 11:35 AM, mrpantsuit <kevin.peter.w...@gmail.com>wrote:
>
> > > I'm seeing a similar memoryleakin 1.7.  Does anyone know if this bug

mrpantsuit

unread,
Dec 7, 2009, 3:05:54 PM12/7/09
to Google Web Toolkit
Sorry, I thought the XMLHttpRequests weren't leaking, but apparently
they still might be.

Here's what I did:
Google Chrome 4.0.249.22 (Development version)
GWT 2.0.0 RC2
Created GWT app: webAppCreator -out MemTest memtest.MemTest
Added this to onModuleLoad():

Timer timer = new Timer() {
@Override
public void run() {
greetingService.greetServer("xxx", new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
}

public void onSuccess(String result) {
}
});
}
};
timer.scheduleRepeating(1 * 1000);

Ran the generated MemTest launcher (OOPHM) and clicked "Launch Default
Browser" (Chrome).

After a couple hours, the mem was 50MB+ (according to "Task
manager"/"Stats for nerds") and Page/Developer/"Developer Tools"/
Profiles/"Heap Snapshot" indicated 2500+ instances of XMLHttpRequest.

Though, the snapshot indicated that only 5MB or so of memory was being
used, so I don't know what is using the other 45MB+.

I also opened a OOPHM session in IE8, and the same steady memory
increase was observed (though the growth was actually slower).

On Dec 4, 3:32 pm, mrpantsuit <kevin.peter.w...@gmail.com> wrote:
> Regarding theXMLHttpRequestleak, it seems I just need to wait for

mrpantsuit

unread,
Dec 7, 2009, 3:26:45 PM12/7/09
to Google Web Toolkit
Oh, eventually windows reports that Chrome has crashed, though
dismissing the error leaves Chrome open (strange). "Developer Tools"/
Scrips shows an error like this every second (the same period as the
RPC timer set up in onModuleLoad() ):

Uncaught Error: Error calling method on NPObject!

kiran kumar

unread,
Dec 15, 2009, 1:02:47 AM12/15/09
to Google Web Toolkit
Hi Rob,

It is not problem with RPC -calls ,i.e 16k of memory leak is due to
gwt-components creation.
to avoid this we need to reuse the old references with new state
inspite of creating new objects for every RPC call.

Thanks
-Kiran.Kuppula



On Nov 13, 7:18 pm, Rob <rob.a.st...@gmail.com> wrote:
> I've been trying out one of my existing apps with GWT 2.0 to see what
> advantages it has and have noticed a majormemoryleakwhen using RPC
> with Internet Explorer 8.0.
>
> Basically my application reads some values from a database and
> displays these in the browser every 1 second. I am seeing amemoryleakof 16k per second - i.e. every time I make an RPC request the
> browser leaks 16k ofmemory. This eventually leads to an out of
> virtualmemorysystem error. If I switch back to using GWT 1.7 then
Reply all
Reply to author
Forward
0 new messages