Re: SoftReferences to PageImpl can cause performance problems

2015-04-02 Thread Robert Schmelzer

Hi,

I do not have the T5 source checked out / buildable - so thats not a 
very easy task for me. I will see if I find time for that.


Our app is not particular lightweight - more a J2EE monster style app - 
650 entities, over 2500 spring beans
The pages we are initializing in Tapestray are consuming several hundred 
MB of RAM holding thousends of components - this make this issue so 
visible to us. I understand that 99% of Tapestry Apps will not face that 
problem.


I would guess following behaviour with normal references:
Test case 1 (2GB): same as before
Test case 2 (1.4GB): not sure about that - maybe GC overhead warning
Test case 3 (1.2GB): OutOfMemory

Robert

Am 02.04.2015 um 03:11 schrieb Kalle Korhonen:

Actually Robert, I'd love it if you could patch/override T5 core just
enough to disable SoftReferences and re-run your test. The results may
surprise you. I could almost guarantee you'd see the same performance
pattern for any modern jpa 2.x application. At 1.2GB, it doesn't look like
your test setup is just a synthetic, lightweight t5 app with no back end,
is it?

Kalle
On Apr 1, 2015 3:44 PM, Kalle Korhonen kalle.o.korho...@gmail.com wrote:


A configurable cache might be ok but what Robert is showing is a highly
typical performance degradation pattern for any sufficiently large Java
application. Tapestry's page cache is hardly the only place where soft
references are used. When your memory budget is too small, most system
engineers would argue that it's far better to slow down the application
than OoM, but obviously that depends on the type of application and the
traffic patterns you are facing. For the consumer facing application, it's
not uncommon to see peak traffic 30-100 times over the averages at least
with the applications I've been involved with and I would hate to to budget
all resources based on peak consumption only. On the other hand, if the
number of pages on the site is small and the site is evenly in use, then
sure, it'd make sense to never purge.

Kalle

On Wed, Apr 1, 2015 at 3:01 PM, Howard Lewis Ship hls...@gmail.com
wrote:


I'm feeling that Robert is making a very good case here. I could imagine a
page-level annotation to either enable or disable evication of a page
instance after a period of time ... but that can come later. I do think
that hard-caching of pages will leading to more predictable response
performance.

On Wed, Apr 1, 2015 at 7:31 AM, Robert Schmelzer rob...@schmelzer.cc
wrote:


Hi,

I now found time to sum up a short report about that topic.

I summarized my results in following pdf file:
http://www.schmelzer.cc/Downloads/Files/Tapestry-Memory-Performance.pdf

The main issue is, that you are able to bring a Tapestry based system

into

a situation where it gets slower and slower and finally event not
responding any more, just be decreasing memory on the JVM and you DO NOT
get any error message or OutOfMemory warning or GC overhead warning.

And

that only because the PageImpl instances are held in SoftReferences. My
opinion is still, that this does not work as it is supposed to do and I
keep with my example about other infrastructure. You would not expect

e.g.

Spring beans or a hibernate configuration to get thrown away under

memory

preasure - you would expect them to fail with OutOfMemory if they are

not

able to hold their necassary static information in memory.

Regards
Robert




Am 19.03.2015 um 17:55 schrieb Kalle Korhonen:


On Thu, Mar 19, 2015 at 12:24 AM, Robert Schmelzer rob...@schmelzer.cc
wrote:

  Sorry, I was unprecise - my example should have referenced to the

EntityManagerFactory (SessionFactoryImpl in Hibernate). You would not
expect them, to throw away its cached configuration on memory

preasure. I

do not either expect that from Tapestry.
I cannot make our results public because of regulatory issues. I will

try

to setup a show case for that and will offer a patch. This will take

me a

few days.

  I don't think we are going to simply do away with the SoftReferences

without any replacements so I wouldn't even attempt at offering such a
patch. I just don't agree that a memory cache should be permanent
construct. If your object is not in a cache, you'll simply incur a

cache

miss and re-create the object on the fly. It is not typical that a

cache

will grow indefinitely. If you are adamant on this approach, you could
probably convince us to add a symbol to control the cache behavior

(i.e.

to
never purge objects from it). Guava has excellent, easily configurable
cache implementations.

Kalle


  Robert

Am 18.03.2015 um 18:19 schrieb Kalle Korhonen:

   On Wed, Mar 18, 2015 at 12:44 AM, Robert Schmelzer

rob...@schmelzer.cc

wrote:

   I do not agree with you on that  point. Tapestry is designed to

cache

the


page. When you do not have enough memory to hold your pages cached
basically the system does not work as designed so you should fail
early.
Otherwise you possible defer the problem to production use. Fail


Re: Refreshing tapestry grid content from another component.

2015-04-02 Thread abangkis
Hi Thiago, thanks for the reply. Yes, after a few try I finally just wrap
the whole grid component in a zone.

I tried
triggering resources.triggerEvent(InternalConstants.GRID_INPLACE_UPDATE,
null, null); from onUpEvent, that trigger from an event link inside the
grid. But that didn't seem to work :)



On Tue, Mar 31, 2015 at 1:58 AM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Sun, 22 Mar 2015 06:36:49 -0300, abangkis abang...@gmail.com wrote:

  Now I'm wondering if there's any way to trigger this behavior from
 another component.


 Have you thought about wrapping it in a Zone?

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




-- 
http://www.mreunionlabs.net/ http://www.mreunion-labs.net/
twitter : @mreunionlabs @abangkis
page : https://plus.google.com/104168782385184990771


Re: Ipage setProperty() method problem in upgrading from tapestry 4.0.1 to 4.1.6

2015-04-02 Thread Geoff Callender
It's replacement is named in the JavaDoc:


http://dev.bjmaxinfo.com/docs/tapestry/4.0.2/tapestry/apidocs/org/apache/tapestry/IComponent.html#setProperty(java.lang.String,%20java.lang.Object)


https://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/util/PropertyUtils.html#read(java.lang.Object,%20java.lang.String)

Geoff

On 1 Apr 2015, at 6:07 pm, Sai Kiran saikiran@gmail.com wrote:

 I am trying to upgrade from tapestry 4.0.1 to tapestry 4.1.6. In tapestry
 4.0.1, for object Ipage we had a function setProperty(String, Throwable)
 but it does not exist in Ipage object in tapestry 4.1.6. Please let me know
 whether the function is deprecated or do we have any alternate function to
 use.



Re: SoftReferences to PageImpl can cause performance problems

2015-04-02 Thread Lance Java
You don't need to build the tapestry source.

Create a custom PageSource implementation by copy / paste / tweaking
PageSourceImpl (lookup source on github) and removing SoftReference usage.
Then use tapestry ioc to override the builtin PageSource service with your
custom impl.