Stay organized with collections
Save and categorize content based on your preferences.
There are multiple situations where the profile collection might not go as
expected:
The profile collection fails due to an internal error. If this happens, the
ProfilingResult API tells you about the errors.
The profile collection fails due to rate limiting. For more information, see
How rate limiting works
The profile collection succeeds, but the app isn't immediately notified.
This can happen if the app crashes during long profile collections. If the
app closes, the system automatically stops and saves the profile. The app is
informed about the collected profile when it restarts and registers a
general listener with ProfilingManager.
How rate limiting works
ProfilingManager includes a rate limiter for both individual apps and the
entire system. The rate limiter prevents apps from using too many system
resources by recording too many profiles, because a full profiling session uses
a lot of resources.
Both the app and system rate limiters assign a cost to each type of profile
collected, because some profiles are more resource-intensive than others. The
app limiter controls how much an individual app can record based on its total
cost. The system limiter, however, controls the total cost of all profiles
recorded by all apps.
The rate limiter sets a total cost that each app can use (this cost is the same
for all apps). Each profile uses a part of this total cost, depending on its
type.
The rate limiter uses three time periods:
Per Hour: There's a maximum cost allowed per hour.
Per Day: There's a maximum cost allowed per day.
Per Week: There's a maximum cost allowed per week.
The rate limiter sets a total cost that can be used within each of these
periods. For example, an app might be allowed to record X profiles per hour, Y
per day, and Z per week. If your app reaches its limit in any of these periods,
future profile requests will result in an ERROR_FAILED_RATE_LIMIT_PROCESS
error.
These time periods work similarly for system-level rate limiting. However, the
system rate limiter is a global limit shared by all apps. This limit is set
separately from the individual app quotas, but every profile contributes to it,
using the same hourly, daily, and weekly periods. If this global limit is
reached, you will receive the ERROR_FAILED_RATE_LIMIT_SYSTEM error.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-07-25 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-25 UTC."],[],[],null,["# Profiling limitations\n\nThere are multiple situations where the profile collection might not go as\nexpected:\n\n- The profile collection fails due to an internal error. If this happens, the [`ProfilingResult`](/reference/android/os/ProfilingResult) API tells you about the errors.\n- The profile collection fails due to rate limiting. For more information, see [How rate limiting works](#how-rate-limiting-works)\n- The profile collection succeeds, but the app isn't immediately notified. This can happen if the app crashes during long profile collections. If the app closes, the system automatically stops and saves the profile. The app is informed about the collected profile when it restarts and registers a general listener with `ProfilingManager`.\n\nHow rate limiting works\n-----------------------\n\n`ProfilingManager` includes a rate limiter for both individual apps and the\nentire system. The rate limiter prevents apps from using too many system\nresources by recording too many profiles, because a full profiling session uses\na lot of resources.\n| **Key Point:** You can tell if your app has been rate-limited by checking the `ProfilingResult`. You will see either the `ERROR_FAILED_RATE_LIMIT_PROCESS` or `ERROR_FAILED_RATE_LIMIT_SYSTEM` error.\n\nBoth the app and system rate limiters assign a cost to each type of profile\ncollected, because some profiles are more resource-intensive than others. The\napp limiter controls how much an individual app can record based on its total\ncost. The system limiter, however, controls the total cost of all profiles\nrecorded by all apps.\n\nThe rate limiter sets a total cost that each app can use (this cost is the same\nfor all apps). Each profile uses a part of this total cost, depending on its\ntype.\n\nThe rate limiter uses three time periods:\n\n- **Per Hour:** There's a maximum cost allowed per hour.\n- **Per Day:** There's a maximum cost allowed per day.\n- **Per Week:** There's a maximum cost allowed per week.\n\nThe rate limiter sets a total cost that can be used within each of these\nperiods. For example, an app might be allowed to record X profiles per hour, Y\nper day, and Z per week. If your app reaches its limit in any of these periods,\nfuture profile requests will result in an `ERROR_FAILED_RATE_LIMIT_PROCESS`\nerror.\n\nThese time periods work similarly for system-level rate limiting. However, the\nsystem rate limiter is a global limit shared by all apps. This limit is set\nseparately from the individual app quotas, but every profile contributes to it,\nusing the same hourly, daily, and weekly periods. If this global limit is\nreached, you will receive the `ERROR_FAILED_RATE_LIMIT_SYSTEM` error.\n| **Tip:** For local profiling, you can [disable the rate limiter](/topic/performance/tracing/profiling-manager/debug-mode#disable-rate-limiter)."]]