I'm having trouble fully understanding Wicket's serialization. 

I understand that if I declare a final object outside of an anonymous inner
class and then use it from within that anonymous inner class, the compiler
will ass a member variable to the anonymous inner class which gets
serialized.

final Object outer = /a 10K entity/;

add(new Label("label", new LoadableDetachableModel() {

    @Override
    protected Object load() {
        return outer;
    }
}));

However if the containing component / page has a large Model 

setDefaultModel(Model.of(/a 50K entity/));

DebugBar Inspector reports that the Label takes up 66.5K (including the 6.1K
debugbar).

Does this mean that all anonymous inner classes, declared within a component
with such a model, will serialize a copy of the container? This seems to be
what the sizes reported by the DebugBar suggests...

(I'm aware of the correct usage of LDMs etc. I'd just like to understand the
consequences of the various anti-patterns)

Thanks,

CN



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DebugBar-reports-strange-sizes-tp4668920p4668926.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to