Skip to content

Commit

Permalink
Improve the memory profiler documentation (#47144)
Browse files Browse the repository at this point in the history
- PProf is a package, not a library
- mention PProf in the docstring and say how to invoke it
- turn URLs into markdown links
  • Loading branch information
fingolfin authored Oct 13, 2022
1 parent 01310a9 commit 40346e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions doc/src/manual/profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ allocation while it is running. It can be invoked with
This information about the allocations is returned as an array of `Alloc`
objects, wrapped in an `AllocResults` object. The best way to visualize
these is currently with the [PProf.jl](https://github.com/JuliaPerf/PProf.jl)
library, which can visualize the call stacks which are making the most
package, which can visualize the call stacks which are making the most
allocations.

The allocation profiler does have significant overhead, so a `sample_rate`
Expand All @@ -362,7 +362,7 @@ Passing `sample_rate=1.0` will make it record everything (which is slow);
`Profile.Allocs.UnknownType`.

You can read more about the missing types and the plan to improve this, here:
https://github.com/JuliaLang/julia/issues/43688.
<https://github.com/JuliaLang/julia/issues/43688>.

## External Profiling

Expand Down
6 changes: 5 additions & 1 deletion stdlib/Profile/src/Allocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@ julia> last(sort(results.allocs, by=x->x.size))
Profile.Allocs.Alloc(Vector{Any}, Base.StackTraces.StackFrame[_new_array_ at array.c:127, ...], 5576)
```
The best way to visualize these is currently with the
[PProf.jl](https://github.com/JuliaPerf/PProf.jl) package,
by invoking `PProf.Allocs.pprof`.
!!! note
The current implementation of the Allocations Profiler does not
capture types for all allocations. Allocations for which the profiler
could not capture the type are represented as having type
`Profile.Allocs.UnknownType`.
You can read more about the missing types and the plan to improve this, here:
https://github.com/JuliaLang/julia/issues/43688.
<https://github.com/JuliaLang/julia/issues/43688>.
!!! compat "Julia 1.8"
The allocation profiler was added in Julia 1.8.
Expand Down

0 comments on commit 40346e1

Please sign in to comment.