Just for fun, suppose you were

* using the Symfony2 framework
* writing a long-running PHP daemon process
* using monolog
* using the fingers-crossed handler at 'error', grouped with
  a stream handler at 'info'
* logging lots of info() messages in said long-running process
* using a buffer_size of 0 for said handler(s)

Is this just asking for a memory leak?

Looks like the default buffer_size is 0, meaning it will buffer forever
if an 'error' message is never handled.

Here's my logging config (did you really think this was just a
hypothetical?):

monolog:
    handlers:
        main:
          type:         fingers_crossed
          action_level: error
          handler:      grouped
        grouped:
          type: group
          members: [nested, mylog]
        nested:
          type:  stream
          path:  %kernel.logs_dir%/%kernel.environment%.log
          level: info
        mylog:
          type: service
          id: adams_custom_log_handler
          level: warning

Something tells me that most use of PHP is short-running, and a
long-running daemon written in PHP is going to have many memory leaks,
if not from PHP core, from the many libraries only considering their
code will be used from within anything besides long-running PHP processes.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to