tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Sung (JIRA)" <tapestry-...@jakarta.apache.org>
Subject [jira] Commented: (TAPESTRY-346) Memory leak then reseting pages..
Date Tue, 03 Jan 2006 09:11:03 GMT
    [ http://issues.apache.org/jira/browse/TAPESTRY-346?page=comments#action_12361583 ] 

Tony Sung commented on TAPESTRY-346:
------------------------------------

We also have the same problem on 4.0rc3. I suspect it's about building up of a lot of page
classes over time when caching is disabled.

I believe that with caching disabled, everytime we load a page, a new page class is created.
But my gc trace show that no class GC occurs throughout the whole application lifecycle, except
when we reload the application tomcat 5.5.14 force discarding of all classes.

So it may be cause by the inability to GC old page classes in runtime, probably caused by
singletons in the page class.

I've tried to look into the source code but failed. I somehow get lost in the "ComponentConstructorFactoryImpl".
Can't figure out where and how Tapestry do the class enhancement.



> Memory leak then reseting pages..
> ---------------------------------
>
>          Key: TAPESTRY-346
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-346
>      Project: Tapestry
>         Type: Bug
>     Versions: 3.0.3
>  Environment: windows xp
>     Reporter: Tomas Jucius
>     Priority: Critical

>
> Here what I have found.. I can't develop my project because of this..
> Because it depends on this feature..
> As we all know tapestry put all things into pool ant it retrieves it
> when you request for page and etc...
> My application sometimes need to reset this pool..
> So I use reset service..
> But after a lot of resets jvm memory becomes full, and I get
> "java.lang.OutOfMemoryError"
> So after each reset some object are not collected.. And some
> references to objects are left.. I could't find where..
> if in class AbstractEngine you comment these lines in clearCachedData  method
> _pageSource.reset();
> _pool.clear();
> when memory usage stops growing bet pool is not cleared:)..
> So I suppose what pool is buggy or something else.. couldn't figure..
> TO SEE THIS BUG DEPLOY NEW APPLICATION WITH THESE FILES:
> -----------------------------HomePage.java-------------------------------
> mport java.io.IOException;
> import java.util.Map;
> import org.apache.tapestry.IMarkupWriter;
> import org.apache.tapestry.IRequestCycle;
> import org.apache.tapestry.Tapestry;
> import org.apache.tapestry.engine.IEngineService;
> import org.apache.tapestry.html.BasePage;
> import org.apache.tapestry.util.prop.PropertyFinder;
> public class HomePage extends BasePage {
>        public void beginResponse(IMarkupWriter writer, IRequestCycle cycle) {
>                // TODO Auto-generated method stub
>                System.out.println("redirect " +
> cycle.getEngine().isResetServiceEnabled() + " " +
> (Runtime.getRuntime().totalMemory()) );
>                redirectToResetService(cycle);
>                try {
>                        Thread.sleep(200);
>                }
>                catch (InterruptedException e) {
>                        // TODO Auto-generated catch block
>                        e.printStackTrace();
>                }
>                super.beginResponse(writer, cycle);
>        }
>        public void redirectToResetService(IRequestCycle cycle) {
>                IEngineService resetService =
> cycle.getEngine().getService(Tapestry.RESET_SERVICE);
>                try {
>                        cycle.getRequestContext().redirect((resetService.getLink(cycle,
> this, null).getURL()));
>                        resetService = null;
>                }
>                catch (IOException e) {
>                        e.printStackTrace();
>                }
>        }
> }
> ------------------------------Home.page-----------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE page-specification PUBLIC
>  "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
>  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
> <!-- generated by Spindle, http://spindle.sourceforge.net -->
> <page-specification class="HomePage">
> </page-specification>
> ---------------------------Home.html------------------------------
> <html>
> <head>
> </head>
> <body>
>   <div jwcid="@Insert" value="leak" />
> </body>
> </html>
> OPEN YOUR APPLICATION WITH EXPLORER IT HAS NO REDIRECTION LIMIT..
> AND YOU CAN SET MAX MEMORY PROPERTY TO: -Xmx3M
> IF THEREIS NO ANY COMPONENT in page when it is not leaking (so I put
> this insert)..
> So maybe of component specifications it is leaking?
> Used profiler.. I didn't see growing any tapestry object only
> java.util.* classes..
> Appreciate all your notes...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message