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

想问一下框架是有内存复用或者管理内存的操作么? #1706

Open
YoooDT opened this issue Mar 25, 2025 · 2 comments
Open

想问一下框架是有内存复用或者管理内存的操作么? #1706

YoooDT opened this issue Mar 25, 2025 · 2 comments

Comments

@YoooDT
Copy link

YoooDT commented Mar 25, 2025

大致流程
1 、 HttpServer.Post("xx", create); 外部通过http调用,进入create接口。

2、 在create中
std::shared_ptr MockObj = CreateTest(params, 1024 * 1024 * 16); //实例化一个Mock,里面分配了16M内存(malloc),返回一个智能指针管理

3、当create接口结束后,Mock中的析构函数,打印执行(free);

4、但是此时查看进程的VmRSS不下降。

@YoooDT
Copy link
Author

YoooDT commented Mar 25, 2025

每个Http请求在框架中是起一次task么?有方法可以看框架中的task么

@Barenboim
Copy link
Contributor

Barenboim commented Mar 25, 2025

1、这个VmRSS不降,应该和我们框架没有关系。内存释放并不会立刻减少RSS的。

2、是的,作为server每个 http 请求都会创建一个server task,回复完成之后释放

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants