arnaud-lb / php-memory-profiler

Memory profiler for PHP. Helps finding memory leaks in PHP scripts.
MIT License
873 stars 52 forks source link

Generate unrecognized profile format #83

Open xxm404 opened 2 years ago

xxm404 commented 2 years ago

Description

The following code:

<?php
memprof_enable();
memprof_dump_pprof(fopen("profile.heap", "w"));

pprof --text profile.heap 

Resulted in this output:

profile.heap: parsing profile: unrecognized profile format
failed to fetch any source profiles

But I expected this output instead:

php-memprof Version

php-memprof 3.0.2

PHP Version

PHP 7.2.26

Operating System

Ubuntu 18.04.4 LTS

xxm404 commented 2 years ago

@arnaud-lb Hi how to solve the above problem.

stracker-phil commented 2 years ago

I get the same results. @arnaud-b I'm happy to investigate and ideally also provide a PR if you can point me to the pprof file format details or link to a working pprof heap file.

Ishan-Batra commented 1 year ago

Got same results as above , can you please help us @arnaud-lb

arnaud-lb commented 1 year ago

I confirm that the generated profiles do not work with the standalone version of pprof installable from https://github.com/google/pprof.

It does work with the gperftools version of pprof (at least with gperftools 2.9 installed with apt install google-perftools on Ubuntu).

For now I would suggest to use the gperftools version.