Recently we've also been investing into a new feature of the UI called Memscope (https://perfetto.dev/docs/visualization/memscope) to put this behind a one-click graphical interface which hides all the complex configuration options of Perfetto and "just works" collecting both Java heap dumps and native heap profiling.
On the analysis side, we then time align them and present it with a new exploration UI. This is still under very active development so it should continue getting better with time :)
If you do play around with the config directly, you can actually configure a "track all allocaitons" mode but in practice this is not super useful: either you end up slowing the device to a complete crawl or you drop lots of data as you just cannot keep up. [1]
In practice, we've found a sampling of 4096 (the default) to provide a very good tradeoff between accuracy and performance.
[1] The option is called `sampling_interval_bytes` and, as the documentation describes (https://perfetto.dev/docs/reference/trace-config-proto#Heapp...), setting it to `1` means perfect accuracy. You usually will also want `block_client` so that the data isn't dropped (but as noted there it slows down the device a lot).
It can be done in background/from CLI as well.