mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-03 18:23:51 +08:00
perf(desktop): switch to the mimalloc global allocator
glibc keeps freed pages in its arena, so RSS did not fall back after the webview was destroyed. mimalloc returns freed memory to the OS, letting the resident footprint settle right after the UI closes.
This commit is contained in:
@@ -15,6 +15,7 @@ tauri-build = { version = "2", features = [] }
|
||||
axum = "0.8"
|
||||
cursor-server = { path = "../../../server" }
|
||||
libc = "0.2"
|
||||
mimalloc = "0.1"
|
||||
rfd = "0.15"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
@@ -6,6 +6,11 @@ mod startup;
|
||||
mod tray;
|
||||
mod update;
|
||||
|
||||
// mimalloc 在释放时主动向操作系统归还内存,避免 glibc 保留页导致
|
||||
// 关闭窗口后 RSS 无法回落到静默启动水平。
|
||||
#[global_allocator]
|
||||
static GLOBAL_ALLOCATOR: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
pub fn run() -> std::process::ExitCode {
|
||||
if let Some(exit_code) = update::run_replacement_if_requested() {
|
||||
return exit_code;
|
||||
|
||||
Reference in New Issue
Block a user