Memory Leak
- Vorherrschende Sprache
- Rust
- Sterne
- 24.8k
- Forks
- 1.9k
- Ø Merge
- 23 Std. 10 Min.
- Gemergte PRs (30 T.)
- 26
Beschreibung
Memory Leak / Memory "not recycled" in Actix 3.3 #1943
The program is active_ On the web, my program has a startup memory of 14MB and requests the interface to perform some operations with a memory of 800MB+. However, the 800MB+in subsequent programs has not been released. What is the reason for this? Some of the language's setting features, or are there any useful tools such as PPROF that can detect memory overflow


Actix_ When web requests return big data, the memory is not released and will continue to be occupied. Is the original intention of this issue and will it be improved in the future
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 = HashMap::with_capacity(100000);
test(&mut h).await;
HttpResponse::InternalServerError().body(format!("{:?}", h))
}
async fn test (h : &mut HashMap){
// tokio::time::sleep(tokio::time::Duration::from_secs(25)).await;
println!("start");
for v in 0..1000000{
h.insert(v,v);
}
}
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.