zed-industries/zed · error

Failed to create events per frame histogram

Error message

Failed to create events per frame histogram: {error}

What it means

In WindowProfiler::new (behind the `profiler` feature): constructing the events-per-frame hdrhistogram failed, aborting profiler initialization. Internal histogram allocation failure within the frame-timing metrics setup.

Solutions

  1. Retry; the error is usually a transient allocation failure in Histogram::new
  2. Check system memory if it occurs repeatedly
  3. Build without the `profiler` feature when frame metrics are unnecessary
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/gpui/src/profiler.rs:929 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@916fc2b8cb (2026-08-20). Data as JSON: /api/errors/a38be6ca0663afa9. Report an issue: GitHub.

Appendix: source

Thrown at crates/gpui/src/profiler.rs:929

#[cfg(feature = "profiler")]
impl WindowProfiler {
    /// Creates a profiler for a window.
    pub fn new(window_id: WindowId) -> anyhow::Result<Self> {
        let profiler = Self {
            window_id,
            active_activities: SmallVec::new(),
            active_actions: SmallVec::new(),
            dirty_to_present_histogram: Histogram::new(3).map_err(|error| {
                anyhow::anyhow!("Failed to create dirty-to-present histogram: {error}")
            })?,
            draw_duration_histogram: Histogram::new(3).map_err(|error| {
                anyhow::anyhow!("Failed to create draw duration histogram: {error}")
            })?,
            present_interval_histogram: Histogram::new(3).map_err(|error| {
                anyhow::anyhow!("Failed to create present interval histogram: {error}")
            })?,
            first_input_at: None,
            pending_input_count: 0,
            input_latency_histogram: Histogram::new(3).map_err(|error| {
                anyhow::anyhow!("Failed to create input latency histogram: {error}")
            })?,
            events_per_frame_histogram: Histogram::new(3).map_err(|error| {
                anyhow::anyhow!("Failed to create events per frame histogram: {error}")
            })?,
            mid_draw_events_dropped: 0,
            last_present_at: None,
            animating_at_last_present: false,
            pending_frame: None,
        };
        journal::record_frame_pending(window_id, Instant::now());
        Ok(profiler)
    }

    /// Records the beginning of an input dispatch. `kind` names the platform
    /// input variant being dispatched (see [`crate::PlatformInput::kind_name`]).

View on GitHub (pinned to 916fc2b8cb)