8000 bug: OOM errors on stream handler as of Monolog 2.3.0 · Issue #1577 · Seldaek/monolog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
bug: OOM errors on stream handler as of Monolog 2.3.0 #1577
Closed
@bshaffer

Description

@bshaffer

Monolog version 2 (only on 2.3.0+)

Error: PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 2147483647 bytes) in...

This can be recreated with the following file (note the php ini setting memory_limit=2048M):

ini_set('memory_limit', '2048M');

$stream = tmpfile();
new Monolog\Handler\StreamHandler($stream);
stream_get_contents($stream);

@dwsupplee tracked the issue down to this change. When I remove the calls to stream_set_chunk_size in the handler, the OOM error disappears.

I don't know the proper solution, if this change should just be reverted, or if we should do something to ensure the memory limit is less than the chunk size... maybe there's some specific handling necessary for tmpfile? Either way, this is a pretty nasty error so any help is appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0