Code profiling
Identify performance bottlenecks at the code level with continuous profiling that shows which methods consume the most CPU time and memory.
Overview
Instana AutoProfile provides continuous code-level profiling to help you understand exactly where your application uses CPU time and resources. Unlike traditional profilers that require manual activation and can impact performance, AutoProfile runs continuously with minimal configuration.
The profiler captures stack traces and aggregates them into flame graphs, showing you which methods are hot spots. This enables targeted optimization—instead of guessing where to improve performance, you can see exactly which code paths need attention.
Key features
Code profiling includes the following key features:
- Continuous profiling: Always-on profiling with minimal performance impact
- Flame graphs: Visual representation of call stacks that show CPU and memory hotspots
- Method-level detail: See exactly which methods use resources
- Time-based analysis: Compare profiles across different time periods
- Trace correlation: Link profiles to specific traces for context
- Multi-language support: Profile Java, Node.js, Python, and other languages
Common use cases
See the following example use cases:
- Performance optimization
- Identify CPU-intensive methods and optimize them for better performance. Focus optimization efforts on code that matters instead of premature optimization.
- Memory leak investigation
- Find methods that allocate excessive memory or hold references too long. Identify memory leaks before they cause out-of-memory errors.
- Slow endpoint analysis
- When a specific endpoint is slow, use profiling to see which code paths are using time. Drill down from traces to profiles for complete context.
- Regression detection
- Compare profiles before and after deployments to detect performance regressions. Identify which code changes introduced performance problems.
Where to find it in the UI
You can access code profiling from the following locations in the UI:
- Service profile: Go to Analytics and select Profile from the drop-down list
- Flame graph: Select a profile and view the interactive flame graph from the CPU, Memory, or Wait time tabs.
- Trace profiles: Access profiles from individual traces in the Applications / Traces view
- Comparison view: Compare profiles across different time periods
- Method details: Click any method in the flame graph for detailed statistics
What problems does this solve?
Code profiling addresses the following common performance challenges:
- Performance mysteries: Understand exactly where your application spends time
- Inefficient optimization: Focus efforts on actual bottlenecks instead of guessing
- Memory issues: Identify memory allocation hotspots and potential leaks
- Production profiling: Profile production systems safely with minimal configuration
- Regression detection: Know about performance regressions due to code changes
Related capabilities
The following capabilities work together with code profiling:
- Distributed tracing - Link traces to profiles for complete context
- Application perspectives - Profile services within perspectives
- Events and incidents - Investigate performance issues with profiling
- Dashboards - Display profiling metrics on dashboards
Learn more
For detailed information about AutoProfile, flame graphs, and optimization techniques, see Profiling documentation.