Skip to content

Conversation

ndr-ds
Copy link
Contributor

@ndr-ds ndr-ds commented Sep 15, 2025

Motivation

For debugging production memory issues, ideally we'll have continuous memory profiling always on.

Proposal

This exposes a couple endpoints:

  • One that generates a pprof and returns it once the endpoint is queried
  • One that generates a flamegraph and returns it once the endpoint is queried

The former will be used by Alloy on the deployment side, to generate profiles every 30 seconds or so. It shows no visible performance regression.

Test Plan

Deployed a network with this and the linera-infra changes, saw the memory flamegraphs on Pyroscope, and managed to curl the flamegraph endpoint and get a memory profile svg returned to me.

Screenshot 2025-09-06 at 02.27.50.png

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

@ndr-ds ndr-ds force-pushed the 09-15-add_feature_to_use_jemalloc_as_memory_allocator branch from 8ce35c8 to d69326d Compare September 16, 2025 03:05
@ndr-ds ndr-ds force-pushed the 09-15-continuous_memory_profiling branch 2 times, most recently from 98e8680 to af8515a Compare September 16, 2025 13:01
@ndr-ds ndr-ds force-pushed the 09-15-add_feature_to_use_jemalloc_as_memory_allocator branch 2 times, most recently from 23a8d18 to a043826 Compare September 16, 2025 17:24
@ndr-ds ndr-ds force-pushed the 09-15-continuous_memory_profiling branch from af8515a to 8d50ce2 Compare September 16, 2025 17:24
@ndr-ds ndr-ds force-pushed the 09-15-add_feature_to_use_jemalloc_as_memory_allocator branch from a043826 to 20adbf7 Compare September 16, 2025 17:39
@ndr-ds ndr-ds force-pushed the 09-15-continuous_memory_profiling branch from 8d50ce2 to 84191d9 Compare September 16, 2025 17:39
@ndr-ds ndr-ds force-pushed the 09-15-add_feature_to_use_jemalloc_as_memory_allocator branch from 20adbf7 to ef98053 Compare September 16, 2025 17:56
@ndr-ds ndr-ds force-pushed the 09-15-continuous_memory_profiling branch from 84191d9 to 6ce4c71 Compare September 16, 2025 17:56
@ndr-ds ndr-ds force-pushed the 09-15-add_feature_to_use_jemalloc_as_memory_allocator branch from ef98053 to eee424e Compare September 16, 2025 17:58
@ndr-ds ndr-ds force-pushed the 09-15-continuous_memory_profiling branch from 6ce4c71 to aef1bc5 Compare September 16, 2025 17:58
Base automatically changed from 09-15-add_feature_to_use_jemalloc_as_memory_allocator to main September 16, 2025 20:21
@ndr-ds ndr-ds force-pushed the 09-15-continuous_memory_profiling branch from aef1bc5 to ded3152 Compare September 16, 2025 20:22
Copy link

graphite-app bot commented Sep 16, 2025

Merge activity

  • Sep 16, 8:22 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@ndr-ds ndr-ds added this pull request to the merge queue Sep 16, 2025
Merged via the queue into main with commit 89bc084 Sep 16, 2025
30 checks passed
@ndr-ds ndr-ds deleted the 09-15-continuous_memory_profiling branch September 16, 2025 21:23
deuszx pushed a commit that referenced this pull request Sep 19, 2025
For debugging production memory issues, ideally we'll have continuous
memory profiling always on.

This exposes a couple endpoints:
* One that generates a pprof and returns it once the endpoint is queried
* One that generates a flamegraph and returns it once the endpoint is
queried

The former will be used by Alloy on the deployment side, to generate
profiles every 30 seconds or so. It shows no visible performance
regression.

Deployed a network with this and the `linera-infra` changes, saw the
memory flamegraphs on Pyroscope, and managed to curl the flamegraph
endpoint and get a memory profile svg returned to me.

![Screenshot 2025-09-06 at
02.27.50.png](https://app.graphite.dev/user-attachments/assets/f5c2407e-af25-4b8c-b43a-9e56258a9373.png)

- Nothing to do / These changes follow the usual release cycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants