On Tuesday, April 4, 2017 at 10:35:51 AM UTC+2, Petr Janeček wrote:
>
> Either my issue is ignored because nobody knows (in which case this is a 
> new bug and I'll gladly file an issue ticket), or because it's been poorly 
> worded.
>
> What we see is *RequestFactory leaking 30 MB/hour of memory due to its 
> internal cache which never invalidates*. On the client. This is probably 
> (?) because of the large amount of Value Proxies being delivered to the 
> client.
>

IIRC, value proxies should have "synthetic IDs", so they won't be cached in 
the IdFactory. The IdFactory, AFAICT, only caches "ephemeral IDs", which 
are those that are created when you create en EntityProxy on the 
client-side (they're later updated with a server ID when the response is 
received).
I might very well be wrong, RequestFactory is really complex and I haven't 
worked on it for months (years?) now.

You're right that ephemeralIds are never removed, and that design is a bit 
strange.
I suspect a bug where value proxies get assigned an ephemeral ID when they 
shouldn't.
 

> My question is - Is there any way to invalidate the cache? Is this a known 
> issue?
>
> I cannot imagine nobody has seen this behaviour before.
>

There haven't been many bugs filed about memory leaks with 
RequestFactory: 
https://github.com/gwtproject/gwt/issues?utf8=%E2%9C%93&q=is%3Aissue%20memory%20leak%20requestfactory%20
 
but those are about Java implementations (server-side or in legacy 
DevMode), not JS.
(I tried variations of the query with "factory", "proxy", "valueproxy", 
"entityproxy", etc. in place of "requestfactory")

Honestly, in 2017, either you're going to debug this yourself and provide a 
patch (I'd review it, and could possibly assist you in the debugging 
process, but I won't have time nor cognitive bandwidth to dig into it 
myself; if you're interested, head over to 
https://groups.google.com/forum/#!forum/google-web-toolkit-contributors to 
discuss the issue further); or switch to another communication mechanism 
(if your value proxy graphs are pure trees, then "just" use JSON with plain 
old RequestBuilder; you could possibly use AutoBeans to reuse your 
ValueProxy interfaces for deserialization on the client-side, possibly 
implementing your RequestContext interfaces yourself –rather than having 
the implementations generated– so your code calling them wouldn't have to 
be changed; the server-side would still have to be changed substantially 
though).

-- 
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+unsubscr...@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.

Reply via email to