The minimal app to reproduce this:

import akka.actor.{Actor, ActorSystem, Props}
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.duration._

object MemoryLeakApp extends App {
  val system = ActorSystem()
  val actor = system.actorOf(Props[MyActor])
  implicit val timeout = Timeout(3.seconds)
  while (true) {
    actor ? "Request"
  }
}

class MyActor extends Actor {
  def receive = {
    case _ =>
      val actor = sender()
      context.watch(actor)
      actor ! "Response"
  }
}


On Sunday, March 29, 2015 at 12:03:43 PM UTC+3, Yaroslav Klymko wrote:
>
> Hi guys,
> Root cause of my issue has been found, in short it is caused by *context 
> watch sender()*, where the sender is PrmiseActorRef.
>
>
> On Sunday, March 29, 2015 at 10:33:47 AM UTC+3, Yaroslav Klymko wrote:
>>
>> So PrmiseActorRef is leaking and keeps reference on Promise & 
>> WriteEventsCompleted, still I'm not able to find a combination of 
>> dispatchers/actors to reproduce on simple example.
>>
>> On Saturday, March 28, 2015 at 9:33:15 PM UTC+2, Yaroslav Klymko wrote:
>>>
>>> Hi guys,
>>> I have a very strange problem, it was originally spotted by @gfduszynski
>>> https://github.com/EventStore/EventStore.Akka.Persistence/issues/11
>>>
>>> Here is a problematic line of code 
>>>
>>> https://github.com/EventStore/EventStore.Akka.Persistence/blob/v2.0.0/src/main/scala/akka/persistence/eventstore/journal/EventStoreJournal.scala#L28
>>>
>>> Basically it is a *actor ? WriteEvents* which returns 
>>> *Future[WriteEventsCompleted]*, these *WriteEventsCompleted* messages 
>>> are leaking, however *actor ! WriteEvents *is not leaking...
>>> Also I couldn't reproduce this using simple app without akka persistence.
>>>
>>>  I will really appreciate any help, any ideas.
>>> Thanks!
>>>
>>>
>>>
>>>
>>> <https://lh3.googleusercontent.com/-GswiQ2lLtTU/VRcAmBy7mDI/AAAAAAAAMHE/0fjbSplbpK4/s1600/Screenshot%2Bat%2BMar%2B28%2B21-26-50.png>
>>>
>>>
>>>
>>> <https://lh3.googleusercontent.com/-iBvp3mltxVs/VRcArTBLSpI/AAAAAAAAMHM/1E9raW_PKnI/s1600/Screenshot%2Bat%2BMar%2B28%2B21-26-35.png>
>>>
>>>
>>>
>>>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to