Folks,

Who has time to do testing, etc. with 2.7.3?

Thanks,

David

---------- Forwarded message ----------
From: Philipp Haller <[email protected]>
Date: Fri, Dec 12, 2008 at 6:42 AM
Subject: Re: [scala-user] Is there a memory leak in 2.7.2 Actors?
To: David Pollak <[email protected]>
Cc: scala-user <[email protected]>


Hi again,

FYI, I committed a fix in r16750 (2.7.x branch) and r16751 (trunk). It
looks like we are probably releasing 2.7.3 including this fix some time
next week (or shortly after).

Cheers,
Philipp


[email protected] wrote:
> Hi,
>
> I found the memory leak. A fix should be ready shortly.
>
> Cheers,
> Philipp
>
>
> Quoting David Pollak <[email protected]>:
>
>> Folks,
>>
>> I've been noticing that Lift apps run out of memory after a certain
>> period of time.  This is a relatively new thing.  I think I've
>> traced the problem back to a memory leak in the Actors library.  The
>>  enclosed program terminates with an out of memory error.
>>
>> Am I failing to release the Actors in some way or is there a memory leak?
>>
>> Thanks,
>>
>> David
>>
>> import scala.actors._
>> import Actor._
>>
>> object ActorWatcher extends Actor {
>>   def act = loop {
>>     react {
>>       case Exit(actor: Actor, why: Throwable) =>
>>         failureFuncs.foreach(f => f(actor, why))
>>       case x => println(x)
>>     }
>>   }
>>
>>   private def startAgain(a: Actor, ignore: Throwable) {a.start}
>>
>>   private def logActorFailure(actor: Actor, why: Throwable) {
>>     println("The ActorWatcher restarted "+actor+" because "+why)
>>   }
>>
>>   /**
>>    * If there's something to do in addition to starting the actor
>> up, pre-pend the
>>    * actor to this List
>>    */
>>   var failureFuncs: List[(Actor, Throwable) => Unit] = logActorFailure _
::
>>   startAgain _ :: Nil
>>
>>   this.start
>>   this.trapExit = true
>> }
>>
>> case object Start
>> case object EndMe
>>
>> class A extends Actor {
>> def act = loop {
>> react {
>> case Start =>
>> link(ActorWatcher)
>> case EndMe =>
>> unlink(ActorWatcher)
>> exit()
>> }
>> }
>> }
>>
>> object Sloth {
>> def z(in: Long) = if (in / 1024L == 0L) in
>> else if (in / (1024L * 1024L) == 0L) (in / 1024L).toString + "K"
>> else (in / (1024L * 1024L)).toString + "M"
>> def main(args: Array[String]) {
>> val rt = Runtime.getRuntime()
>> for (o <- 1 to 1000000) {
>> println("Outer "+o)
>> //var a: List[Actor] = Nil
>>      for (i <- 1 to 10000) {
>> val t = new A
>> //a = t :: a
>> t.start
>> t ! Start
>> t ! EndMe
>> }
>> println("Done creating")
>> // for (act <- a) act ! EndMe
>> ActorGC.gc()
>> rt.gc()
>> println("Free "+z(rt.freeMemory())+" total "+z(rt.totalMemory()))
>> }
>> }
>> }
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Collaborative Task Management http://much4.us
>> Follow me: http://twitter.com/dpp
>> Git some: http://github.com/dpp
>>
>
>




-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to