You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org> on 2005/07/21 16:03:21 UTC

[jira] Commented: (TAPESTRY-346) Memory leak then reseting pages..

    [ http://issues.apache.org/jira/browse/TAPESTRY-346?page=comments#action_12316354 ] 

Howard M. Lewis Ship commented on TAPESTRY-346:
-----------------------------------------------

I suspect this is just how you are using the reset service:

             try {
                       cycle.getRequestContext().redirect((resetService.getLink(cycle,
this, null).getURL()));
                       resetService = null;


The last parameter to the reset service should be an array of objects; it should be a single object, the name of the page to display.

I'm not sure why this gets into any kind of loop in your code.

The OutOfMemory exception would be because of recursive stack .... do you do anything wierd in terms of exception reporting (such as returning to the home page).

Others do not see your issues of memory useage.  Tapestry memory useage "tops off" after all pages and components are parsed into memory.

> 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