does JsonpRequestBuilder clean up after itself?

50 views
Skip to first unread message

Christopher Piggott

unread,
May 8, 2012, 2:56:39 PM5/8/12
to google-we...@googlegroups.com

I'm watching my server make requests using JsonpRequestBuilder on a timer:

src - - [08/May/2012:18:52:08 +0000] "GET /data/live/jsonp?jsonp=__gwt_jsonp__.P72.onSuccess HTTP/1.1" 200 198
src - - [08/May/2012:18:52:18 +0000] "GET /data/live/jsonp?jsonp=__gwt_jsonp__.P73.onSuccess HTTP/1.1" 200 198
src - - [08/May/2012:18:52:28 +0000] "GET /data/live/jsonp?jsonp=__gwt_jsonp__.P74.onSuccess HTTP/1.1" 200 198
src - - [08/May/2012:18:52:39 +0000] "GET /data/live/jsonp?jsonp=__gwt_jsonp__.P75.onSuccess HTTP/1.1" 200 198

This has me wondering ... does it clean up after itself?  Or does it keep adding more and more methods (each one only called once ever) to the DOM until it eventually runs the browser out of memory?

--Chris

Chris Price

unread,
May 8, 2012, 3:38:11 PM5/8/12
to google-we...@googlegroups.com
It looks like as long as you aren't specifying an id for the
JsonpRequest then everything gets cleaned up in the unload method [1]
which is invoked internally by the success and failure handlers.

[1] http://code.google.com/searchframe#T04cSGC7sWI/trunk/user/src/com/google/gwt/jsonp/client/JsonpRequest.java&l=316
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/N8Vk42zBNhEJ.
> 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.

Christopher Piggott

unread,
May 8, 2012, 3:50:17 PM5/8/12
to google-we...@googlegroups.com
Oh OK, thanks,  I didn't grok that when I looked at it, but I see it now.

Knowing that specifying an ID is possible, I might want to do that.  I'm making the same requests over and over, constantly updating the same data.



On Tuesday, May 8, 2012 3:38:11 PM UTC-4, Chris Price wrote:
It looks like as long as you aren't specifying an id for the
JsonpRequest then everything gets cleaned up in the unload method [1]
which is invoked internally by the success and failure handlers.

[1] http://code.google.com/searchframe#T04cSGC7sWI/trunk/user/src/com/google/gwt/jsonp/client/JsonpRequest.java&l=316

Joseph Lust

unread,
May 10, 2012, 11:33:06 AM5/10/12
to google-we...@googlegroups.com
Piggott,

Have you tried taking memory heap snapshots in Chrome to confirm this? It is there in the dev tools. You can also use SHIFT+ESC to bring up the task manager for each tab to see how much memory that tab is using in real time.

Sincerely,
Joseph
Reply all
Reply to author
Forward
0 new messages