View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000234 | file | General | public | 2021-02-03 12:13 | 2021-02-05 21:34 |
Reporter | halaei | Assigned To | christos | ||
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Product Version | 5.38 | ||||
Fixed in Version | 5.40 | ||||
Summary | 0000234: Memory problems running finfo::buffer with PHP_CLI | ||||
Description | PHP internally uses libmagic for getting information about files. This sample php code consumes 483 MB of RAM for detecting mimetype of a 48 MB MP3 file using php7.4 but it uses only 56 MB with php7.2. $finfo = new finfo(FILEINFO_MIME_TYPE, ''); $contents = file_get_contents('file.mp3'); echo($finfo->buffer($contents)); The bug is reported to php as well. They say it should be reported to libmagic. See https://bugs.php.net/bug.php?id=79263 The PHP bug is over 1 year old. I reported the bug here as well: https://bugs.launchpad.net/ubuntu/+bug/1914401 .Maybe it wasn't the right place | ||||
Steps To Reproduce | Having a large file.mp3 file. Run the following using php 7.4: <?php $finfo = new finfo(FILEINFO_MIME_TYPE, ''); $contents = file_get_contents('file.mp3'); echo($finfo->buffer($contents)); echo(memory_get_peak_usage(true)/1024/1024); | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2021-02-03 12:13 | halaei | New Issue | |
2021-02-05 21:34 | christos | Assigned To | => christos |
2021-02-05 21:34 | christos | Status | new => assigned |
2021-02-05 21:34 | christos | Status | assigned => resolved |
2021-02-05 21:34 | christos | Resolution | open => fixed |
2021-02-05 21:34 | christos | Fixed in Version | => 5.40 |
2021-02-05 21:34 | christos | Note Added: 0003533 |