Im currently working with two actors in scala. One, the producer, produces some data and sends it to a parcer. The producer sends a HashMap[String,HashMap[Object,List[Int]]]
through a message (along with this to mark the sender):
parcer ! (this,data)
The parser is constantly waiting for messages like so:
def act(){
loop{
react{
case (producer, data)=> parse(data);
}
}
}
The program runs perfectly in normal circunstances. The problem comes with big volumes of data and many messages sent (The hash has about 10^4 elements, the inner hash about 100 elements and the list is 100 long), the program crashes. It shows no Error nor Exception. It just stopps.
The problem seems to be that my producer works much faster than the parser (and for the moment I don't want more than one parser).
After reading scala mailbox size limit I wonder if my parser's mailbox is reaching it's limit. The post also offers some solutions, but I first need to make sure this is the problem. How can I test this?
Is there a way to know the actor's memory limit? What about reading the used/free memory in the mailbox?
Any suggestions for the workflow that haven't been posted in that link are also welcome.
Thanks,