ProxyAutoBean server-side cache

121 views
Skip to first unread message

juli...@googlemail.com

unread,
Mar 24, 2011, 7:43:42 AM3/24/11
to Google Web Toolkit
Hi,

it appears that for every EntityProxy instance that a client requests
via RequestFactory, a ProxyAutoBean object is created on the server.
Is this correct? If so, what is the lifecycle of the ProxyAutoBean,
at what point does it get deleted? I can see (in jvisualvm) that it
lives in a WeakMapping, so maybe it is intended to be removed when the
GC needs the memory it occupies. However, a few initial tests seem to
show that the ProxyAutoBeans survive low memory conditions and keep
accumulating. Am I doing something wrong or is this expected
behaviour?

Thomas Broyer

unread,
Mar 25, 2011, 8:05:36 AM3/25/11
to google-we...@googlegroups.com, juli...@googlemail.com, bo...@google.com, rj...@google.com
[Cc: BobV, rjrjr]

That would explain why our test server regularly becomes unresponsive and needs a restart (we shipped our first milestone on Monday for our customer to start testing it; I don't think they complained yet, fortunately; it hadn't beat us earlier as we test on our CI server which is rebuilt and restarted at least once a day)

Looking at the code, ProxyAutoBean's createShim creates a reference cycle (the shim references the proxyAutoBean, which keeps a reference on the shim). Because the value in the WeakMapping is kept with a strong reference, there's always a strong reference to key as well, so the cleanup() never has anything to clean.

Julian Scheid

unread,
Mar 25, 2011, 4:57:26 PM3/25/11
to google-we...@googlegroups.com, Thomas Broyer, bo...@google.com, rj...@google.com
On Sat, Mar 26, 2011 at 1:05 AM, Thomas Broyer <t.br...@gmail.com> wrote:
> Looking at the code, ProxyAutoBean's createShim creates a reference cycle
> (the shim references the proxyAutoBean, which keeps a reference on the
> shim). Because the value in the WeakMapping is kept with a strong reference,
> there's always a strong reference to key as well, so the cleanup() never has
> anything to clean.

Right, that would explain it... I suppose with the Googlers in CC
there's no need for me to file a bug report?

And while I got you guys on the line, would you mind having a quick
look at another recent RF-related post of mine, maybe you missed it at
the time I posted it?
http://groups.google.com/group/google-web-toolkit/msg/21bc3c893c96f4c6?hl=en

Thomas Broyer

unread,
Mar 28, 2011, 5:52:10 AM3/28/11
to google-we...@googlegroups.com, bo...@google.com, rj...@google.com, Julian Scheid
Opened an issue: http://code.google.com/p/google-web-toolkit/issues/detail?id=6193

Will send a patch of the "fixed" WeakMapping soon, after I test it a bit. A unit-test using System.gc() proved the memory is reclaimed, but I'd have to test it a bit to make sure it doesn't cause any issue!

Patrick Cailly

unread,
Mar 28, 2011, 6:06:29 AM3/28/11
to google-we...@googlegroups.com
Thanks for that reply
 
If the problem is caused by a circular reference ,
does it mean that the problem disapear whe the reference is a reference to another Entity
let's say , I could have Root entity an a Patronyme Entity and Patronyme chained to Root to solve the problem
( or the fix should available soon ? )
 
Patrick
--
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.



Aucun virus trouvé dans ce message.
Analyse effectuée par AVG - www.avg.fr
Version: 10.0.1204 / Base de données virale: 1498/3535 - Date: 28/03/2011

Reply all
Reply to author
Forward
0 new messages