Skip to content

Commit

Permalink
add documentation about memory profiling on linux (vercel#2776)
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra authored Jan 13, 2023
1 parent e6b27e8 commit 21874f0
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/pages/pack/docs/advanced/profiling.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Profiling
title: Profiling
description: Learn how to profile Turbopack
---

Expand Down Expand Up @@ -51,6 +51,26 @@ Once the program exits, the profiler will open the trace file in Instruments. Re
caption="An example trace from the time profiler."
/>
## Linux
### Memory usage
``` sh
# Install `heaptrack` and `heaptrack_gui`
sudo apt install heaptrack heaptrack_gui

# Compile with debug info but without the alternative allocator:
CARGO_PROFILE_RELEASE_DEBUG=1 cargo build --bin next-dev --release --no-default-features --features cli

# Run the binary with heaptrack (it will be much slower than usual)
heaptrack target/release/next-dev [...]

# Stop it anytime

# Open the GUI and open the heaptrack.next-dev.XXX.gz file
heaptrack_gui
```
## On other platforms
We currently don't have a guide for profiling Turbopack on other platforms.
Expand Down

0 comments on commit 21874f0

Please sign in to comment.