You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Tomas Jucius (JIRA)" <ta...@jakarta.apache.org> on 2005/06/20 12:16:18 UTC

[jira] Created: (TAPESTRY-347) Memory leak then reseting pages..

Memory leak then reseting pages.. 
----------------------------------

         Key: TAPESTRY-347
         URL: http://issues.apache.org/jira/browse/TAPESTRY-347
     Project: Tapestry
        Type: Bug
  Components: Framework  
    Versions: 3.0.3    
    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..


-- 
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


[jira] Resolved: (TAPESTRY-347) Memory leak then reseting pages..

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-347?page=all ]
     
Howard M. Lewis Ship resolved TAPESTRY-347:
-------------------------------------------

    Resolution: Duplicate

> Memory leak then reseting pages..
> ---------------------------------
>
>          Key: TAPESTRY-347
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-347
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 3.0.3
>     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..

-- 
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