Skip to content

Error with analyze dump memory #49

@Shkarbatov

Description

@Shkarbatov

Hi! Trying to make memory dump:

gc_collect_cycles();
meminfo_dump(fopen('/home/dmitriy/phpmem/my_dump_file.json', 'w'));`

Then run analyzer and receive an error:

$ analyzer/bin/analyzer summary my_dump_file.json

[Symfony\Component\Serializer\Exception\UnexpectedValueException]  
Control character error, possibly incorrectly encoded    
$ ls -al
-rw-rw-r--  1 dmitriy dmitriy 8093889 Ноя 21 15:30 my_dump_file.json

In memory dump I have next item:

    "0x7f31bcb13620" : {
        "type" : "array",
        "size" : "72",
        "is_root" : false
,
        "children" : {
            "1|	":"0x7f31be24dca0"
        }

    }

Why dump create this "1| ":"0x7f31be24dca0" ?
This is not valid json.


Second question:

$ analyzer/bin/analyzer ref-path 0x7f254b257c20 my_dump_file100.json 

Found 2 paths
Path from 0x7f255ce562c0
0x7f254b257c20
      ^       
      |       
_entityManager
      |       
      |       
0x7f254b2d1d40
      ^       
      |       
runningCommand
      |       
      |       
0x7f255ce562c0

Path from 0x7f255ce562e0
0x7f254b257c20
      ^       
      |       
_entityManager
      |       
      |       
0x7f254b2d1d40
      ^       
      |       
runningCommand
      |       
      |       
0x7f255ce562c0
      ^       
      |       
 application  
      |       
      |       
0x7f255ce562e0

It is not, what I see here: https://github.com/BitOne/php-meminfo/blob/master/doc/hunting_down_memory_leaks.md#4-finding-references-to-the-leaked-object

How to understand with this output like you write in your example:

So the reason why our object is still in memory is because it's in an array, that is itself in another array that is in an final array. And the final array is directly linked to the variable declared in the frame and called myRootArray.

I think you need to add parameter -v in example:

$ bin/analyzer ref-path 0x7f94a1877068 /tmp/php_mem_dump.json

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions