Skip to content

PHP: unref key and value in metadata #13660

Merged
stanley-cheung merged 1 commit intogrpc:masterfrom
ZhouyihaiDing:php-memory-leak
Jan 23, 2018
Merged

PHP: unref key and value in metadata #13660
stanley-cheung merged 1 commit intogrpc:masterfrom
ZhouyihaiDing:php-memory-leak

Conversation

@ZhouyihaiDing
Copy link
Copy Markdown
Contributor

This is reported by Valgrind:

==17317== 1,632 bytes in 16 blocks are definitely lost in loss record 119 of 133
==17317==    at 0x4C2DB2F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17317==    by 0x9926CEE: gpr_malloc (in /usr/local/lib/libgrpc.so.5.0.0-dev)
==17317==    by 0x98C8902: grpc_slice_malloc_large (in /usr/local/lib/libgrpc.so.5.0.0-dev)
==17317==    by 0x98C8989: grpc_slice_malloc (in /usr/local/lib/libgrpc.so.5.0.0-dev)
==17317==    by 0x98C89D2: grpc_slice_from_copied_buffer (in /usr/local/lib/libgrpc.so.5.0.0-dev)
==17317==    by 0x96660F2: create_metadata_array (call.c:169)
==17317==    by 0x966679C: zim_Call_startBatch (call.c:306)
==17317==    by 0x3F157D: ??? (in /usr/bin/php7.0)
==17317==    by 0x3ABDDA: execute_ex (in /usr/bin/php7.0)
==17317==    by 0x35BDB7: zend_call_function (in /usr/bin/php7.0)
==17317==    by 0x2A6B0E: zif_call_user_func_array (in /usr/bin/php7.0)
==17317==    by 0x3F0A9C: ??? (in /usr/bin/php7.0)

Unref like what ruby call does can fix it.
https://github.com/grpc/grpc/blob/e759d2ad7abdb0702970eeccc5f033ff4b2a4c7f/src/ruby/ext/grpc/rb_call.c#L652:6

@thelinuxfoundation
Copy link
Copy Markdown

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@thelinuxfoundation
Copy link
Copy Markdown

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@stanley-cheung stanley-cheung merged commit b609da5 into grpc:master Jan 23, 2018
stanley-cheung added a commit that referenced this pull request Jan 24, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants