cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From informations_se...@gmx.at
Subject Possible memleak in Cocoon/Rhino with continuations
Date Wed, 07 Jun 2006 12:24:20 GMT

Hi!

Given the following code:

---------------------------------
WAC.prototype.myFunc = function()
{
  var myString = null;
  cocoon.sendPageAndWait( ...);
					
  myString = new Packages.java.lang.String("a string!");
  var length = myString.length();
  length = null;
  myString = null;
}
---------------------------------

I observed that a reference to the Java string is referenced by the
continuation created via sendPageAndWait ...

The object graph is as follows:
continuation->state(InterpreterState)->vars(Object[])->(NativeJavaObject)->String

I also have a screenshot of the object tree available under 
http://rra.amd.co.at/pics/cont_memleak.gif

In our case we have an huge Filestream Object instead of the string, which
causes a leak and ultimately crashes the application server. 

Note that there's NO reference if I comment out
the following two lines:

---------------------------------
WAC.prototype.myFunc = function()
{
  var myString = null;
  cocoon.sendPageAndWait( ...);
					
  myString = new Packages.java.lang.String("a string!");
  //var length = myString.length();
  //length = null;
  myString = null;
}
---------------------------------

So assignment seems to cause a reference inside the continuation. 

This happens with Cocoon 2.1.5

Any hints, is this a bug?

Thanks,
Roman



-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Mime
View raw message