Sunday, April 2, 2017

IdFactory.ephemeralIds - ever-growing collection?

Unless I'm missing something extraordinarily unusual, the ephemeralIds field in the IdFactory class looks to be add-only, there's no apparent way of clearing / reducing the size of the collection.

What we're doing:

We have a application that seems to grow in memory in time on the client without any clear way to release that memory. The client makes an appRequest every 5 seconds and gets a graph of ~150 value proxies from the server in response. The client usually simply throws this away, but sometimes makes subsequent calls to request details on some of the object, the responses could contain thousands of value proxies. In exchange for the new obtained obejcts, it gets rid of old ones.

Even though the client seems to release all unused objects well (including event handlers and all proxies), it seems to grow at rate of ~30 MB/hour when left on a single page, unattended. Obviously, over a night or a weekend, this results in a browser crash.

Inspecting the JS heap revealed an ever-growing collection ephemeralIds held by our RequestFactory (see the screenshot attached - it's from the Chrome Dev Tools heap dump). Are we supposed to throw-away and recreate our request factory upon a page reload (and, in this case, after a fixed time, let's say an hour)? Is there any way for this ephemeral id thing to ever get smaller? I can't imagine we would be first ones to bump into such a memory bloat, so I'm assuming we're doing something wrong.

Our app is using GWT 2.7.0, Activities+Places, Request-factory, no entity proxies, only value proxies. Proxies only go from server to client. Client is not passive, but makes its calls using simple types and primitives.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment