GoLand 2026.1 Help

Introduction to profiling

Profiling is a type of runtime analysis that operates on large amounts of runtime data and gives you a birds-eye view of what is happening inside a process. The collected data relates to various aspects of program operation, such as CPU usage, memory %allocation, and threads' activity.

Profiling can be instantaneous, like capturing a memory snapshot, or long-running. For example, the CPU profiler can collect data during arbitrarily large periods of time, like hours or even days of program operation.

When is profiling helpful?

Profiling tools help you:

  • Identify bugs, bottlenecks and diagnose poor performance

  • Identify hot spots and opportunities for optimization (not necessarily related to a performance problem)

  • Assess or compare the performance of different solutions

  • Get a better understanding of how a program operates under the hood

Available profilers

GoLand provides several profilers. Each profiler focuses on a specific type of performance data.

  • The CPU profiler measures how much CPU time each function uses.

  • The memory profiler tracks memory usage and allocation patterns.

    An allocation is a request to reserve memory for data, for example when you create a slice or a struct. This profiler helps you find where your program uses too much memory or creates many short-lived objects.

  • The blocking profiler detects blocking operations and shows where goroutines wait.

    A blocking operation is an operation that pauses execution until a condition is met. For example, a goroutine can wait for a channel, a lock, or I/O. This profiler helps you find where execution stops and slows down your program.

  • The mutex profiler analyzes mutex contention and synchronization overhead.

    A mutex is a lock that protects shared data. Mutex contention happens when multiple goroutines try to acquire the same lock at the same time. Synchronization overhead is the extra time your program spends managing locks instead of doing useful work.

Configure Go profilers

You can configure the Go profilers in the IDE settings. Each profiler collects a specific type of performance data.

Configure Go profilers

  1. Open settings by pressing Ctrl+Alt+S and navigate to Build, Execution, Deployment | Go Profiler.

  2. Configure the profiler parameters:

    • The CPU profiler records CPU usage during execution. It does not require additional parameters.

    • The memory profiler records memory allocations.

      Use Profile rate to define how often the profiler samples allocations. A lower value increases detail but adds overhead. Leave the field empty to use the default value.

    • The blocking profiler records blocking events.

      Use Profile rate to define how often the profiler samples blocking events. Set the value to 1 to record all events. Leave the field empty to use the default value.

    • The mutex profiler records mutex contention events.

      Use Profile fraction to define what portion of events the profiler records. A higher value increases detail. Leave the field empty to use the default value.

How profiling works

GoLand uses the standard Go pprof tool to collect profiling data.

When you start profiling, the IDE builds your application with a temporary overlay. The overlay injects profiling hooks into the build without modifying your source files.

The IDE runs a command similar to the following:

GOROOT=/path/to/go GOPATH=/path/to/gopath go build -overlay /tmp/goland_overlay.json -o /tmp/binary /tmp/binary

The overlay file defines temporary changes that enable profiling. GoLand removes these changes after the run completes.

29 July 2025