We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
程序是actix_web的,我的程序启动的时候14MB的内存,请求接口会用800MB+的内存执行一些操作。然而,后续接口返回大量数据后程序中的800MB+尚未回收。这是什么原因?该语言的一些设置功能,或者有没有像PPROF这样的有用工具可以检测内存溢出
然后发现 大多web框架都有这个问题
use actix_web::{get, HttpResponse, Responder}; use crate::controller::link_inspection::check::LinkInspection; use std::collections::HashMap; #[get("/check")] async fn check() -> impl Responder { // 启动堆分析器 // let res = LinkInspection::new().doing().await; // match res { // Ok(response) => HttpResponse::Ok().json(response), // Err(error) => HttpResponse::InternalServerError().body(error.to_string()), // } let mut h: HashMap<i64,i64> = HashMap::with_capacity(100000); test(&mut h).await; HttpResponse::InternalServerError().body(format!("{:?}", h)) } async fn test (h : &mut HashMap<i64,i64>){ // tokio::time::sleep(tokio::time::Duration::from_secs(25)).await; println!("start"); for v in 0..1000000{ h.insert(v,v); } }
The text was updated successfully, but these errors were encountered:
具体案例 查看 actix/actix-web#3198
Sorry, something went wrong.
No branches or pull requests
程序是actix_web的,我的程序启动的时候14MB的内存,请求接口会用800MB+的内存执行一些操作。然而,后续接口返回大量数据后程序中的800MB+尚未回收。这是什么原因?该语言的一些设置功能,或者有没有像PPROF这样的有用工具可以检测内存溢出
然后发现 大多web框架都有这个问题
The text was updated successfully, but these errors were encountered: