Skip to content

a new process run Consumer client show out of memory #3

@blackluckycharm

Description

@blackluckycharm

php 7.2

swoole 4.4.16

kafka 7.8.1

swoft 2.0.8

a new process run Consumer client

====================================================================
public function run(Process $process): void
{

     Co::create(function(){

         $config = new ConsumerConfig();
         $config->setBroker('127.0.0.1:9092');
         $config->setTopic('ordertest');
         $consumer = new Consumer($config);

         while (true) {
             $message = $consumer->consume();
             if($message)
             {
                 CLog::info($message->getKey() . ':' . $message->getValue());
                 $consumer->ack($message->getPartition()); // ack
             }
         }
     });
}

=====================================================================

error:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /home/www/swoft/vendor/longlang/phpkafka/src/Protocol/Type/ArrayInt32.php on line 60
PHP Fatal error: Uncaught ErrorException: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /home/www/swoft/vendor/longlang/phpkafka/src/Protocol/Type/ArrayInt32.php:60
Stack trace:

=====================================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions