zed-industries/zed · error

Failed to create draw duration histogram: {error}

Error message

Failed to create draw duration histogram: {error}

What it means

Error from WindowProfiler::new when hdrhistogram's Histogram::new(3) fails while creating the draw-duration histogram; the profiler cannot be constructed, so window profiling for this window is aborted.

Source

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

    pending_input_count: u64,
    input_latency_histogram: Histogram<u64>,
    events_per_frame_histogram: Histogram<u64>,
    mid_draw_events_dropped: u64,
    last_present_at: Option<Instant>,
    animating_at_last_present: bool,
    pending_frame: Option<FrameTiming>,
}

#[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(),
            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());

View on GitHub (pinned to f4178619ac)

Solutions

  1. Retry window creation; the failure is typically an allocation error in Histogram::new
  2. Check available system memory if failures repeat
  3. Disable the `profiler` feature if histograms are not needed for the build
Defensive patterns

Strategy: validation

When it happens

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

Common situations: See trigger scenarios.


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