Memory problems running finfo::buffer with PHP_CLI
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
file (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug 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_
$contents = file_get_
echo(
The bug is reported to php as well. They say it should be reported to libmagic. See https:/
The PHP bug is over 1 year old.
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libmagic1 1:5.32-2ubuntu0.4
ProcVersionSign
Uname: Linux 4.15.0-135-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7.21
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Wed Feb 3 15:04:30 2021
Dependencies:
gcc-8-base 8.4.0-1ubuntu1~
libc6 2.27-3ubuntu1.4
libgcc1 1:8.4.0-
libmagic-mgc 1:5.32-2ubuntu0.4
zlib1g 1:1.2.11.
InstallationDate: Installed on 2018-10-07 (849 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
ProcEnviron:
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: file
UpgradeStatus: No upgrade log present (probably fresh install)
affects: | ubuntu → file (Ubuntu) |