Yeah.. there should really be a warning or a fatal exception in this case.. it
is an easy mistake for beginners.
I even knew to look for it and I couldn't find it..
D/
On Nov 16, 2010, at 12:05 PM, Martijn Dashorst wrote:
> DON'T DO THIS:
>
> the offending code probably was:
>
> add(new Label("id", new PropertyModel(getSession(), "someProperty")));
>
> This hard links the session to the page, and causes a cycle when serializing.
>
> Martijn
>
> On Tue, Nov 16, 2010 at 6:59 PM, jcgarciam <[email protected]> wrote:
>>
>> Douglas, can you share any insight of how having the session in the property
>> model could actually provoke this leak?
>>
>> It seems weird.
>>
>> On Tue, Nov 16, 2010 at 2:56 PM, Igor Vaynberg-2 [via Apache Wicket] <
>> [email protected]<ml-node%[email protected]>
>>> wrote:
>>
>>> it is perfectly valid to use page as the model object. in fact if you
>>> wanted to pull something out of session you can simply say new
>>> PropertyModel(this, "session.property"), this being the Page instance
>>> you are in.
>>>
>>> -igor
>>>
>>> On Tue, Nov 16, 2010 at 9:46 AM, Douglas Ferguson
>>> <[hidden email] <http://user/SendEmail.jtp?type=node&node=3045359&i=0>>
>>> wrote:
>>>
>>>> We found it.. Finally!!!
>>>>
>>>> There was a property model that was using the session as the model
>>> object.
>>>>
>>>> It would be cool if PropertyModel, etc would check for this and blow up
>>> on construction.
>>>> i.e. not allow Page, Session, Application as the model object...
>>>>
>>>> D/
>>>> On Nov 16, 2010, at 11:20 AM, Douglas Ferguson wrote:
>>>>
>>>>> Just tested on 1.4.13 and it still happens
>>>>>
>>>>> On Nov 16, 2010, at 9:43 AM, Douglas Ferguson wrote:
>>>>>
>>>>>> 1.4.12, but the problem has been around since a few versions back.
>>>>>>
>>>>>> D/
>>>>>>
>>>>>> On Nov 16, 2010, at 12:43 AM, Martijn Dashorst wrote:
>>>>>>
>>>>>>> Are you using 1.4.13?
>>>>>>>
>>>>>>> Martijn
>>>>>>>
>>>>>>> On Tue, Nov 16, 2010 at 5:54 AM, Douglas Ferguson
>>>>>>> <[hidden email]<http://user/SendEmail.jtp?type=node&node=3045359&i=1>>
>>> wrote:
>>>>>>>> Some time ago I posted to the list regarding a stack overflow error
>>> that I was receiving and the advice was to make sure that I didn't have a
>>> page storing a reference to another page.
>>>>>>>> We did track this down and have just had to ignore it in the
>>> production logs. Now we've made it a priority to track this down.
>>>>>>>>
>>>>>>>> Anyway, we've recently tracked this down to
>>> "AutomaticMultiWindowSupport" feature. We are able to recreate the bug by
>>> pasting a url into a new browser window and thus generating a new pagemap.
>>> On a certain page the memory consumption doubles as you generate new
>>> pagemaps (see the chart below). The profile is indicating that the memory is
>>> being taken up by a hashmap, but that's as far as we've been able to trace
>>> it so far.
>>>>>>>>
>>>>>>>>> PageMap # Size Growth
>>>>>>>>> 13 389523448 1.93
>>>>>>>>> 12 202059096 1.93
>>>>>>>>> 11 104804096 1.93
>>>>>>>>> 10 54352280 1.93
>>>>>>>>> 9 28182760 1.93
>>>>>>>>> 8 14594976 1.93
>>>>>>>>> 7 7549336 1.94
>>>>>>>>> 6 3900704 1.94
>>>>>>>>> 5 2013480 2
>>>>>>>>> 4 1006960 2
>>>>>>>>> 3 503696 2
>>>>>>>>> 2 252072 1.86
>>>>>>>>> 1 135704
>>>>>>>>
>>>>>>>>
>>>>>>>> Any thoughts or tips on trying to get to the bottom of this one?
>>>>>>>>
>>>>>>>> Here's the stack trace
>>>>>>>>
>>>>>>>>> at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
>>>>>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>>> Source)
>>>>>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>>>>>> at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>>>>>>>> at java.util.LinkedList.writeObject(Unknown Source)
>>>>>>>>> at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
>>>>>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>>> Source)
>>>>>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>>>>>> at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>
>>>>>>>>> at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
>>>
>>>>>>>>> at org.apache.wicket.Component.writeObject(Component.java:4660)
>>>>>>>>> at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
>>>>>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>>> Source)
>>>>>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>>>>>> at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeArray(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
>>>
>>>>>>>>> at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
>>> Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>>>>>>>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>>>>>>>> at
>>> org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121)
>>>
>>>>>>>>> at java.io.ObjectOutputStream.writeObject(Unknown Source)
>>>>>>>>> at
>>> org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1124)
>>>>>>>>> at
>>> org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
>>>
>>>>>>>>> at
>>> org.apache.wicket.protocol.http.pagestore.DiskPageStore.prepareForSerialization(DiskPageStore.java:1190)
>>>
>>>>>>>>> at
>>> org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.writeObject(SecondLevelCacheSessionStore.java:389)
>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Become a Wicket expert, learn from the best:
>>> http://wicketinaction.com <http://wicketinaction.com?by-user=t>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: [hidden
>>>>>>> email]<http://user/SendEmail.jtp?type=node&node=3045359&i=2>
>>>>>>> For additional commands, e-mail: [hidden
>>>>>>> email]<http://user/SendEmail.jtp?type=node&node=3045359&i=3>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden
>>>> email]<http://user/SendEmail.jtp?type=node&node=3045359&i=4>
>>>> For additional commands, e-mail: [hidden
>>>> email]<http://user/SendEmail.jtp?type=node&node=3045359&i=5>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden
>>> email]<http://user/SendEmail.jtp?type=node&node=3045359&i=6>
>>> For additional commands, e-mail: [hidden
>>> email]<http://user/SendEmail.jtp?type=node&node=3045359&i=7>
>>>
>>>
>>>
>>> ------------------------------
>>> View message @
>>> http://apache-wicket.1842946.n4.nabble.com/StackOverflowError-tp3044241p3045359.html
>>> To start a new topic under Apache Wicket, email
>>> [email protected]<ml-node%[email protected]>
>>> To unsubscribe from Apache Wicket, click
>>> here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>.
>>>
>>>
>>>
>>
>>
>> --
>> Sincerely,
>> JC (http://www.linkedin.com/in/jcgarciam)
>> Work smarter, not harder!.
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/StackOverflowError-tp3044241p3045367.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]
>>
>>
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]