Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] curl导致内存泄漏 #1

Open
dixyes opened this issue Apr 13, 2021 · 1 comment
Open

[bug] curl导致内存泄漏 #1

dixyes opened this issue Apr 13, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@dixyes
Copy link
Owner

dixyes commented Apr 13, 2021

Describe the bug / 问题描述

在开启多个curl multi handle后内存不断增长

To Reproduce / 如何复现

  1. 编译安装最新ci分支的swow源码
  2. 执行curl_leaks.php
  3. 观察到内存使用不断增长

Expected behavior / 正确的行为

内存占用应当有回落

Outputs / 程序输出

mem: 0k
mem: 2k
mem: 4k
mem: 6k
mem: 8k
mem: 10k
...

Runtime Environment / 运行环境

OS:

Linux DIXXPSArch 5.10.13-arch1-1 #1 SMP PREEMPT Wed, 03 Feb 2021 23:44:07 +0000 x86_64 GNU/Linux
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux

PHP: 7.3.99 开启debug和ZTS

Additional context / 补充说明

curl_leaks.php:

<?php
// demo code not written yet
@dixyes dixyes added the bug Something isn't working label Apr 13, 2021
@dixyes
Copy link
Owner Author

dixyes commented Apr 13, 2021

这是个问题模板,测试用

dixyes pushed a commit that referenced this issue Feb 28, 2022
Now we can use native zend_unwind_exit to kill coroutines, and we no longer need to escape JIT opcode handlers check.

The most important things is we make main Coroutine be the #1 object, and its destructor will be called at first, then it will find all coroutines and to destruct them one by one, this can solve many stranger problems, otherwise, some internal object will be destructed before Coroutines (e.g. Channel), this will cause some problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant