Closed Emmerman closed 14 years ago
Thank you for report. Please provide the sources.
I mean that I need the sources to reproduce the problem.
class Example extends AppInstance { public $memory;
public $cache;
public function init()
{
Daemon::log('Example up.');
$self = & $this;
$this->memory = memory_get_usage();
$this->cache = Daemon::$appResolver->getInstanceByAppName('MemcacheClient');
$RTEP = Daemon::$appResolver->getInstanceByAppName('RTEP');
$RTEP->operations['memget'] = function($session, $packet, $args, & $response) use ($self)
{
$key = $args[1];
$self->cache->get($key, function($answer) use ($session, $key, $self)
{
$session->send(array('type' => 'event', 'event' => array(
'key' => $key,
'value' => $answer->result
)));
$self->status();
});
};
}
public function status()
{
$memory = memory_get_usage();
if ($memory !== $this->memory)
{
$diff = $memory - $this->memory;
Daemon::log('Memory '.$memory.' ('.($diff > 0 ? '+' : '').$diff.')');
$this->memory = $memory;
}
}
}
I have about 300-400kb leaks after 1k connections (1 operation per connection).
I still can't figure out where is the leak.
I think issue #14 have fixed it. But I will test it later.
Closed.
I wrote some simple tests with rtep+memcache+mongo and face a memory leak problem after each session. Unfortunately, I still can't find source of this leaks.