PerformanceDebugOverlay 3.1.0
dotnet add package PerformanceDebugOverlay --version 3.1.0
NuGet\Install-Package PerformanceDebugOverlay -Version 3.1.0
<PackageReference Include="PerformanceDebugOverlay" Version="3.1.0" />
<PackageVersion Include="PerformanceDebugOverlay" Version="3.1.0" />
<PackageReference Include="PerformanceDebugOverlay" />
paket add PerformanceDebugOverlay --version 3.1.0
#r "nuget: PerformanceDebugOverlay, 3.1.0"
#:package PerformanceDebugOverlay@3.1.0
#addin nuget:?package=PerformanceDebugOverlay&version=3.1.0
#tool nuget:?package=PerformanceDebugOverlay&version=3.1.0
## PerformanceDebugOverlay (v3.1.0)
A real-time performance overlay for .NET MAUI that tracks FPS, CPU, memory, GC, battery, and network usage, while providing a load-time component tree—all without major changes to your app code.

## Features
Overall score (0–10) – built from the enabled metrics and your thresholds; stays visible in compact mode
FPS & FrameTime – calculated using EMA (Exponential Moving Average)
Jank & 1% low FPS – dropped frames per second and the FPS of the slowest 1% of frames; last and highest hitch (> 200 ms)
CPU usage – per-process CPU utilization ( not available on iOS )
Memory usage – current and peak memory, allocations/sec, native heap (Android)
GC activity – collections per generation, % of time paused by GC, managed heap size and fragmentation
Threading – thread pool threads, queued work items (starvation), completed items/sec, lock contentions/sec
Exceptions – thrown exceptions per second (including caught ones) and the type of the last one
JIT – compiled methods and compilation time (optional)
Battery – approximate consumption in mW, charge level and temperature (Android only)
Network stats – requests, failed requests, average request time, requests in flight + AI
Page info – startup time, page load time, visual element count and tree depth, and pages still in memory after they left the navigation stack (possible leaks)
Charts – small charts of the last 2 minutes for FPS, CPU, memory and allocations
Collapsible sections – tap a section title (Frame, CPU, Memory, …) to fold it; the ➖ button switches to a one-line compact view
Configurable thresholds – the green / yellow / red limits (e.g. memory for tablets) through PerformanceOverlayOptions.Thresholds
History tab (📜) – every page appearance with load time, memory before / after and element count, a summary per page, and the leaked pages
Copy report (📋) – copies a text report (device, current values, 2-minute trend, navigation history) to the clipboard, ready for a bug report
Live drag & reposition – move the overlay freely at runtime
Plug-and-play integration – works globally without modifying existing HTTP code
Tree View of Load-Time Components with Metrics + AI
Collapse/Expand tree view items
Scrollable TreeView
AI assistance for performance improvement suggestions ( use your own Gemini API key ): "Analyze current performance" in the AI tab sends the whole report, plus [Ask AI] in the Diagnostics, Network and Tree tabs
## Installation
Add the NuGet package to your project:
dotnet add package PerformanceDebugOverlay --version 3.1.0
## Configuration
in MauiProgram.cs
using MauiPerfDebugOverlay.Extensions;
using MauiPerfDebugOverlay.Models;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UsePerformanceDebugOverlay(new PerformanceOverlayOptions
{
ShowBatteryUsage = true,
ShowNetworkStats = true,
ShowAlloc_GC = true,
ShowCPU_Usage = true, //NOT AVAILABLE ON iOS
ShowFrame = true,
ShowMemory = true,
ShowLoadTime = true,
ShowOverallScore = true,
ShowThreading = true,
ShowExceptions = true,
ShowJit = false,
ShowPageInfo = true,
ShowCharts = true,
Thresholds = new PerformanceThresholds { MemoryWarningMb = 500, MemoryDangerMb = 800 }, // optional, defaults suit phones
LoadTimeWarning = 200,
LoadTimeDanger = 450,
GeminiAPIKey = "YOUR_API_KEY", // optional
GeminiModel = "gemini-3.8-flash", // optional, default
CheckForUpdates = true, // default; set false to skip the NuGet update check
AttachToPage = page => page is not LoginPage // optional: choose which pages get the overlay
});
return builder.Build();
}
}
Options are optional and can be enabled or disabled individually.
Activation in Your App
In App.xaml.cs:
public App()
{
InitializeComponent();
// Enable the PerformanceOverlay globally
PerformanceOverlayManager.Instance.Enable();
MainPage = new AppShell();
}
The overlay will appear automatically and is interactive.
## Notes
Battery consumption metrics are only available on Android. Other platforms will display N/A.
Leaked pages: a page is reported when it is still in memory after a full (gen2) GC that ran after it left the navigation stack. Usual causes are event handlers on long-lived objects, static references or view models that outlive the page. Pages you keep on purpose (e.g. registered as singletons) are reported too.
Page load is measured from the moment the page gets its handler until its first layout after Loaded, so the page constructor (InitializeComponent) is not included.
Networking metrics automatically monitor all HttpClient requests without modifying existing code.
Popup pages (e.g. CommunityToolkit.Maui popups) never get the overlay.
On startup the overlay checks NuGet once for a newer stable release on the same major line (3.x for .NET 10) and shows a notice at the top of the overlay if one exists. The check is skipped silently when offline; disable it with CheckForUpdates = false.
Overlay is fully configurable and extensible.
## Simple API
PerformanceOverlayManager.Instance.Show() – show the overlay
PerformanceOverlayManager.Instance.Hide() – hide the overlay
PerformanceOverlayManager.Instance.Disable() – remove the overlay from all pages (Enable() turns it back on)
The data is also available in code, e.g. for logs or automated UI tests:
PerformanceOverlayManager.Instance.CurrentSnapshot – the latest sample (PerformanceSnapshot), taken once per second while an overlay is on screen
PerformanceOverlayManager.Instance.GetHistory() – the samples of the last 2 minutes
PerformanceOverlayManager.Instance.GetNavigationHistory() – the page appearances (NavigationRecord)
PerformanceOverlayManager.Instance.GetReport() – the same text report as the 📋 button
PerformanceOverlayManager.Instance.SnapshotUpdated += snapshot => ... – raised on the UI thread after each sample (unsubscribe when done)
Configuration is done via PerformanceOverlayOptions to customize which metrics are displayed
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. net10.0-ios26.0 is compatible. net10.0-maccatalyst26.0 is compatible. net10.0-windows10.0.19041 is compatible. |
-
net10.0-android36.0
- Microsoft.Maui.Controls (>= 10.0.110)
- Microsoft.Maui.Controls.Compatibility (>= 10.0.110)
-
net10.0-ios26.0
- Microsoft.Maui.Controls (>= 10.0.110)
- Microsoft.Maui.Controls.Compatibility (>= 10.0.110)
-
net10.0-maccatalyst26.0
- Microsoft.Maui.Controls (>= 10.0.110)
- Microsoft.Maui.Controls.Compatibility (>= 10.0.110)
-
net10.0-windows10.0.19041
- Microsoft.Maui.Controls (>= 10.0.110)
- Microsoft.Maui.Controls.Compatibility (>= 10.0.110)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Overall score is shown again (also in compact mode) and uses only the enabled metrics.
- New frame metrics: jank (% dropped frames) and 1% low FPS. Hitches now show the real frame time and reset when the page reappears.
- New GC metrics: % of time paused by GC, managed heap size and fragmentation. Memory shows peak and native heap (Android).
- New options: ShowThreading (thread pool, lock contention), ShowExceptions, ShowJit, ShowPageInfo (startup, page load time, element count / depth, leaked pages), ShowOverallScore.
- Network summary on the General tab (requests, errors, average time, in flight) when ShowNetworkStats is on.
- Battery shows charge level and temperature (Android).
- General tab: collapsible sections, charts of the last 2 minutes (ShowCharts), scrolls when taller than the page. Compact mode moved to the ➖ button.
- Configurable color / score limits: PerformanceOverlayOptions.Thresholds.
- New History tab (📜): page appearances with load time, memory before / after, element count, per-page summary and leaked pages.
- Copy report (📋) and a data API: PerformanceOverlayManager.Instance.CurrentSnapshot, GetHistory(), GetNavigationHistory(), GetReport(), SnapshotUpdated.
- AI tab: "Analyze current performance" sends the whole report (current values, trend, navigations) to Gemini.
- One shared sampler for all overlays instead of one timer per page.
- Fixed: per-element load times were kept forever (memory grew with every element created); they are now released with their elements.