Skip to content

Commit

Permalink
fix: panic when dumping memory profile (#12276)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyufjh committed Sep 29, 2023
1 parent c9185f5 commit 197a9e6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ arrow-schema = "46"
arrow-buffer = "46"
arrow-flight = "46"
arrow-select = "46"
tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [
"profiling",
"stats",
], rev = "64a2d9" }

risingwave_backup = { path = "./src/storage/backup" }
risingwave_batch = { path = "./src/batch" }
Expand Down
2 changes: 1 addition & 1 deletion src/batch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ rand = "0.8"
tempfile = "3"

[target.'cfg(unix)'.dev-dependencies]
tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "b7f9f3" }
tikv-jemallocator = { workspace = true }

[[bench]]
name = "filter"
Expand Down
6 changes: 2 additions & 4 deletions src/cmd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ workspace-hack = { path = "../workspace-hack" }
task_stats_alloc = { path = "../utils/task_stats_alloc" }

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [
"profiling",
"stats",
tikv-jemallocator = { workspace = true, features = [
"unprefixed_malloc_on_supported_platforms",
], rev = "b7f9f3" }
] }

[[bin]]
name = "frontend"
Expand Down
12 changes: 7 additions & 5 deletions src/cmd_all/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@ workspace-hack = { path = "../workspace-hack" }
expect-test = "1"

[build-dependencies]
vergen = { version = "8", default-features = false, features = ["build", "git", "gitcl"] }
vergen = { version = "8", default-features = false, features = [
"build",
"git",
"gitcl",
] }

[target.'cfg(enable_task_local_alloc)'.dependencies]
task_stats_alloc = { path = "../utils/task_stats_alloc" }

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [
"profiling",
"stats",
tikv-jemallocator = { workspace = true, features = [
"unprefixed_malloc_on_supported_platforms",
], rev = "b7f9f3" }
] }

[[bin]]
name = "risingwave"
Expand Down
2 changes: 1 addition & 1 deletion src/compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ tower = { version = "0.4", features = ["util", "load-shed"] }
tracing = "0.1"

[target.'cfg(target_os = "linux")'.dependencies]
tikv-jemalloc-ctl = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "b7f9f3" }
tikv-jemalloc-ctl = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" }
[target.'cfg(not(madsim))'.dependencies]
workspace-hack = { path = "../workspace-hack" }

Expand Down
5 changes: 2 additions & 3 deletions src/compute/src/memory_management/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ impl JemallocMemoryControl {
.unwrap()
.to_string()
} else {
let prof_prefix_mib = jemalloc_prof::prefix::mib().unwrap();
let prof_prefix = prof_prefix_mib.read().unwrap();
let mut file_path = prof_prefix.to_string_lossy().to_string();
let prof_prefix = jemalloc_opt::prof_prefix::read().unwrap();
let mut file_path = prof_prefix.to_str().unwrap().to_string();
file_path.push_str(&file_name);
file_path
};
Expand Down
4 changes: 1 addition & 3 deletions src/tests/simulation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ serde_derive = "1.0.188"
serde_json = "1.0.105"
sqllogictest = "0.15.3"
tempfile = "3"
tikv-jemallocator = { git = "https://github.com/risingwavelabs/jemallocator.git", features = [
"profiling",
], rev = "b7f9f3" }
tikv-jemallocator = { workspace = true }
tokio = { version = "0.2.23", package = "madsim-tokio" }
tokio-postgres = "0.7"
tracing = "0.1"
Expand Down

0 comments on commit 197a9e6

Please sign in to comment.