Il giorno 23/giu/07, alle ore 09:19, Musachy Barroso ha scritto:

Struts 2 uses freemarker to generate the html for the tags, for example for
the form tag this template is used:

http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/ resources/template/simple/form.ftl?view=markup

So struts asks freemarker to generate the html for the struts tag. Freemarker looks at the template and outputs the html based on it. Freemarker is caching the template in memory to not have to read them from the disk every time. Looks similar to what jsp compiler do with the difference that jsp tags have "hard-coded" html and freemarker has template based html. Am I right ?

But what's the various BeanWrappers doing in the previous process ? It's about the passing of "parameters" from the struts tag to FreeMarker ? It's the BeanWrappers that was consuming a lot of memory before I enabled caching of them.



I was playing with jrockit also and trying to replicate the problem, but it is kind of hard :). Do you have any testcase, or a page, something that
could help us replicate the problem?


The jrcmd command that's used to profiling is not working on my server :( I posted a question on the bea forum.... This problem is a hell !!! :)

I don't think I can produce a testcase but I try to tell how is the application organized (btw you can view the site on www.elettrotop.com but don't think this can help to solve the problem...).

I have a MaxDB (formerly SAPDB) database that's accessed ONLY through EJB3 session beans / entity beans. I'm using JBoss 4.0.5-GA which uses Hibernate 3. The view is composed of struts2 actions, a few servlets producing PDFs and images and jsp pages.

All the view logic is inside struts2 actions and they access the database using RMI call to stateless and stateful session beans. Now it's all inside the same server but this architecture gives me the option to separate the web interface (with the option to have more than one web server) from the business logic (maybe on another server) and the database (maybe on another server).

I've implemented a lot of caching of (mostly read-only) database data in the struts actions but the profiler says that less than 100MB are used by my classes. Also the cache lasts at least a Session life so it can't be part of the 2GB that's collected since this happens every 10 seconds or less (using sun jvm). I've checked I don't have _unfortunately_ a lot sessions that dies every 10 seconds :)

Most used page of the site is the product listings where the user can browse an "in ram" list of dataobjects created with an ejb3 query in a session bean. The entire list is returned and cached for struts2 action as said above.

When I first profiled the app, the most ram demanding classes was freemarker.ext.beans..... generated HashMaps (between 400 and 500 mb).


--
Ing. Andrea Vettori
Consulente per l'Information Technology



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to