You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts/resource-limits-and-performance-optimization.md
+25-26Lines changed: 25 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Resource limits and performance optimization for Office Add-ins
3
3
description: Learn about the resource limits of the Office Add-in platform, including CPU and memory.
4
-
ms.date: 01/15/2024
4
+
ms.date: 07/14/2025
5
5
ms.localizationpriority: medium
6
6
---
7
7
@@ -11,23 +11,29 @@ Quality add-ins must performs within specific requirements for CPU core usage, m
11
11
12
12
## Resource usage limits for add-ins
13
13
14
-
The following runtime resource limits apply to all add-ins running in Office clients on Windows and Mac, but not on mobile apps or in a browser.
14
+
> [!NOTE]
15
+
> The resource limits in this section only apply to Excel, Outlook on Mac (classic), PowerPoint, and Word.
16
+
17
+
The following runtime resource limits apply to add-ins running in Office clients on Windows and Mac, but not on mobile apps or in a browser.
15
18
16
-
-**CPU core usage** - A single CPU core usage threshold of 90%, observed 3 times in 5-second intervals by default.
19
+
-**CPU core usage** - A single CPU core usage threshold of 90%, observed three times in five-second intervals by default.
17
20
18
-
If the Office client detects the CPU core usage of an add-in is above the threshold value, it displays a message asking if the user wants to continue running the add-in. If the user chooses to continue, the Office client does not ask the user again during that edit session. The default interval for an Office client to check CPU core usage is every 5 seconds. Administrators can use the **AlertInterval** registry key to raise the threshold to reduce the display of this warning message if users run CPU-intensive add-ins.
21
+
If the Office client detects the CPU core usage of an add-in is above the threshold value, it displays a message asking if the user wants to continue running the add-in. If the user chooses to continue, the Office client does not ask the user again during that edit session. The default interval for an Office client to check CPU core usage is every five seconds. Administrators can use the **AlertInterval** registry key to raise the threshold to reduce the display of this warning message if users run CPU-intensive add-ins.
19
22
20
23
-**Memory usage** - A default memory usage threshold that is dynamically determined based on the available physical memory of the device.
21
24
22
-
By default, when a Office client detects that physical memory usage on a device exceeds 80% of the available memory, the client starts monitoring the add-in's memory usage. This is done at the document level for content and task pane add-ins and at the mailbox level for Outlook add-ins. At a default interval of 5 seconds, the client warns the user if physical memory usage for a set of add-ins at the document or mailbox level exceeds 50%. This memory usage limit uses physical rather than virtual memory to ensure performance on devices with limited RAM, such as tablets. Administrators can override this dynamic setting with an explicit limit by using the **MemoryAlertThreshold** Windows registry key as a global setting. They can also adjust the alert interval with the **AlertInterval** key.
25
+
By default, when a Office client detects that physical memory usage on a device exceeds 80% of the available memory, the client starts monitoring the add-in's memory usage. This is done at the document level for content and task pane add-ins and at the mailbox level for Outlook add-ins. At a default interval of five seconds, the client warns the user if physical memory usage for a set of add-ins at the document or mailbox level exceeds 50%. This memory usage limit uses physical rather than virtual memory to ensure performance on devices with limited RAM, such as tablets. Administrators can override this dynamic setting with an explicit limit by using the **MemoryAlertThreshold** Windows registry key as a global setting. They can also adjust the alert interval with the **AlertInterval** key.
23
26
24
-
-**Crash tolerance** - A default limit of 4 crashes during the document's session.
27
+
-**Crash tolerance** - A default limit of four crashes during the document's session.
25
28
26
29
Administrators can adjust the threshold for crashes by using the **RestartManagerRetryLimit** registry key.
27
30
28
-
-**Application blocking** - A prolonged unresponsiveness threshold of 5 seconds.
31
+
-**Application blocking** - A prolonged unresponsiveness threshold of five seconds.
29
32
30
-
This affects the user's experiences of the add-in and the Office application. When this occurs, the Office application automatically restarts all the active add-ins for a document or mailbox (where applicable), and warns the user which add-in became unresponsive. Add-ins reach this threshold when they do not regularly yield processing while performing long-running tasks. There are techniques listed later in this article to help ensure the add-in doesn't block the Office application. Administrators cannot override this threshold.
33
+
This affects the user's experiences of the add-in and the Office application. When this occurs, the Office application automatically restarts all the active add-ins for a document or mailbox (where applicable), and warns the user which add-in became unresponsive. Add-ins reach this threshold when they don't regularly yield processing while performing long-running tasks. There are techniques listed later in this article to help ensure the add-in doesn't block the Office application. Administrators cannot override this threshold.
34
+
35
+
> [!NOTE]
36
+
> Although only Outlook on Mac (classic) monitors resource usage, if the client makes an Outlook add-in unavailable, the add-in also become unavailable in other supported Outlook clients.
31
37
32
38
### Task pane and content add-ins
33
39
@@ -36,22 +42,20 @@ If any content or task pane add-in exceeds the preceding thresholds on CPU core
36
42
- Restart the add-in.
37
43
- Cancel further alerts about exceeding that threshold. Ideally, the user should then delete the add-in from the document. Continued use of the add-in would risk further performance and stability issues.
38
44
39
-
### Outlook add-ins
45
+
### Evaluation response time for regular expressions in Outlook add-ins
40
46
41
-
If any Outlook add-in exceeds the preceding thresholds for CPU core or memory usage, or tolerance limit for crashes, the add-in becomes unavailable. The Exchange Admin Center displays the add-in's status.
42
-
43
-
> [!NOTE]
44
-
> Even though only Outlook on Windows (classic) and on Mac monitor resource usage, if either of these clients makes an Outlook add-in unavailable, that add-in also becomes unavailable in Outlook on the web, on mobile devices, and in [new Outlook on Windows](https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627).
45
-
46
-
In addition to the CPU core, memory, and reliability rules, Outlook add-ins should observe the following rules on activation.
47
+
Outlook add-ins that use regular expressions and run in Outlook on Windows (classic) or on Mac (classic) should observe the following rules on activation.
47
48
48
49
-**Regular expressions response time** - A default threshold of 1,000 milliseconds for Outlook to evaluate all regular expressions in the manifest of an Outlook add-in. Exceeding the threshold causes Outlook to retry evaluation at a later time.
49
50
50
-
Administrators can adjust this default threshold value of 1,000 milliseconds by using a group policy or application-specific setting for the **OutlookActivationAlertThreshold** key in the Windows registry.
51
+
In classic Outlook on Windows, administrators can adjust this default threshold value of 1,000 milliseconds by using a group policy or application-specific setting for the `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\WEF\Outlook\ActivationAlertThreshold` DWORD value in the Windows registry.
51
52
52
-
-**Regular expressions re-evaluation** - A default limit of 3 times for Outlook to reevaluate all the regular expressions in a manifest. If evaluation fails to evaluate within the time limit 3 times, Outlook makes the add-in unavailable.
53
+
-**Regular expressions re-evaluation** - A default limit of three times for Outlook to reevaluate all the regular expressions in a manifest. If evaluation fails three times, the user must switch to a different mail item then switch back to retry evaluation.
53
54
54
-
administrators can adjust this number of times to retry evaluation by using a group policy or application-specific setting for the **OutlookActivationManagerRetryLimit** key in the Windows registry.
55
+
Administrators can adjust this number of times to retry evaluation by using a group policy or application-specific setting. The location of the setting depends on the platform.
56
+
57
+
-**Windows**: The `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\WEF\Outlook\ActivationRetryLimit` DWORD value in the Windows registry.
58
+
-**Mac**: The `ActivationRetryLimit` property list in `~/Library/Preferences`.
55
59
56
60
### Excel add-ins
57
61
@@ -70,12 +74,7 @@ Office provides a Telemetry Log that maintains a record of certain events (loadi
For each event that the Telemetry Log tracks for an add-in, there is a date/time of the occurrence, event ID, severity, and short descriptive title for the event, the friendly name and unique ID of the add-in, and the application that logged the event. Refresh the Telemetry Log to see the current tracked events. The following table shows examples of Outlook add-ins that were tracked in the Telemetry log.
For each event that the Telemetry Log tracks for an add-in, there is a date/time of the occurrence, event ID, severity, and short descriptive title for the event, the friendly name and unique ID of the add-in, and the application that logged the event. Refresh the Telemetry Log to see the current tracked events.
79
78
80
79
The following table lists the events that the Telemetry Log tracks for Office Add-ins.
81
80
@@ -98,7 +97,7 @@ While the resources limits on CPU and memory usage, crash tolerance, and UI resp
98
97
99
98
- If your add-in needs to read a large volume of data from an unbounded dataset, you can apply paging when reading the data from a table, or reduce the size of data in each shorter read operation, rather than attempting to complete the read in one single operation. You can do this through the [setTimeout](https://developer.mozilla.org/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout) method of the global object to limit the duration of input and output. It also handles the data in defined chunks instead of randomly unbounded data. Another option is to use [async](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/async_function) to handle your Promises.
100
99
101
-
- If your add-in uses a CPU-intensive algorithm to process a large volume of data, you can use [web workers](https://developer.mozilla.org/docs/Web/API/Web_Workers_API) to perform the long-running task in the background while running a separate script in the foreground, such as displaying progress in the user interface. Web workers do not block user activities and allow the HTML page to remain responsive. For an example of web workers, see [The Basics of Web Workers](https://www.html5rocks.com/tutorials/workers/basics/).
100
+
- If your add-in uses a CPU-intensive algorithm to process a large volume of data, you can use [web workers](https://developer.mozilla.org/docs/Web/API/Web_Workers_API) to perform the long-running task in the background while running a separate script in the foreground, such as displaying progress in the user interface. Web workers don't block user activities and allow the HTML page to remain responsive. For an example of web workers, see [The Basics of Web Workers](https://www.html5rocks.com/tutorials/workers/basics/).
102
101
103
102
- If your add-in uses a CPU-intensive algorithm but you can divide the data input or output into smaller sets, consider creating a web service, passing the data to the web service to off-load the CPU, and waiting for an asynchronous callback.
Note that needing to untrack objects only becomes important when you're dealing with thousands of them. Most add-ins do not need to manage proxy object tracking.
145
+
Note that needing to untrack objects only becomes important when you're dealing with thousands of them. Most add-ins don't need to manage proxy object tracking.
Copy file name to clipboardExpand all lines: docs/outlook/limits-for-activation-and-javascript-api-for-outlook-add-ins.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Limits for activation and API usage in Outlook add-ins
3
3
description: Be aware of certain activation and API usage guidelines, and implement your add-ins to stay within these limits.
4
-
ms.date: 03/25/2025
4
+
ms.date: 07/14/2025
5
5
ms.topic: best-practice
6
6
ms.localizationpriority: medium
7
7
---
@@ -68,11 +68,11 @@ Follow these guidelines when designing activation rules for [contextual Outlook
68
68
69
69
The following table lists the limits and describes the differences in the support for regular expressions across Outlook clients. The support is independent of any specific type of device and item body.
70
70
71
-
|Outlook on the web, on new Windows client, and on mobile devices|Outlook on Windows (classic) and on Mac|
72
-
|:-----|:-----|
73
-
|Clients use regular expression evaluation that's part of JavaScript. It's provided by the browser and supports a superset of ECMAScript 5.|Clients use the C++ regular expression engine provided as part of the Visual Studio standard template library. This engine complies with ECMAScript 5 standards.|
74
-
|You should test each regex thoroughly on each Outlook client. If a regex returns different results, rewrite the regex.|Because of the different regex engines, a regex that includes a custom character class based on predefined character classes may return different results in Outlook on Windows (classic) and on Mac versus in Outlook on the web, on mobile devices, and in [new Outlook on Windows](https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627).<br/><br/>As an example, the regex `[\s\S]{0,100}` matches any number, between 0 and 100, of single characters that is a whitespace or a non-whitespace. This regex returns different results depending on your Outlook client.<br/><br/>As a workaround, you should rewrite the regex as `(\s\|\S){0,100}`. This regex matches any number, between 0 and 100, of white space or non-white space.<br/><br/>You should test each regex thoroughly on each Outlook client. If a regex returns different results, rewrite the regex.|
75
-
|The resource monitoring and registry settings supported in Outlook on Windows (classic) and on Mac aren't supported in Outlook on the web, on mobile devices, and in new Outlook on Windows. However, add-ins with regular expressions that require excessive amount of evaluation time in Outlook on Windows (classic) and on Mac are disabled for the same mailbox on all the Outlook clients.|By default, the evaluation of all regular expressions for an add-in is limited to one second. Exceeding this limit causes reevaluation of up to three times. Beyond the reevaluation limit, Outlook on Windows (classic) and on Mac prevent the add-in from running for the same mailbox in any of the Outlook clients.<br/><br/>Administrators can override these evaluation limits by using the `OutlookActivationAlertThreshold` and `OutlookActivationManagerRetryLimit` registry keys.|
71
+
||Outlook on the web, on new Windows client, and on mobile devices|Outlook on Windows (classic) and on Mac|
72
+
|:-----|:-----|:-----|
73
+
|**Regex engine**|Clients use regular expression evaluation that's part of JavaScript. It's provided by the browser and supports a superset of ECMAScript 5.|Clients use the C++ regular expression engine provided as part of the Visual Studio standard template library. This engine complies with ECMAScript 5 standards.|
74
+
|**Results returned**|You should test each regex thoroughly on each Outlook client. If a regex returns different results, rewrite the regex.|Because of the different regex engines, a regex that includes a custom character class based on predefined character classes may return different results in Outlook on Windows (classic) and on Mac versus in Outlook on the web, on mobile devices, and in [new Outlook on Windows](https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627).<br/><br/>As an example, the regex `[\s\S]{0,100}` matches any number, between 0 and 100, of single characters that is a whitespace or a non-whitespace. This regex returns different results depending on your Outlook client.<br/><br/>As a workaround, you should rewrite the regex as `(\s\|\S){0,100}`. This regex matches any number, between 0 and 100, of white space or non-white space.<br/><br/>You should test each regex thoroughly on each Outlook client. If a regex returns different results, rewrite the regex.|
75
+
|**Evaluation time limit settings**|In Outlook on the web, on Mac (new UI), on mobile devices, and on the new Outlook on Windows, the `ActivationAlertThreshold` and `ActivationRetryLimit` evaluation limit settings for regular expressions aren't supported.|In Outlook on Windows (classic) and on Mac (classic UI), by default, the evaluation of all regular expressions for an add-in is limited to one second. Exceeding this limit causes reevaluation of up to three times. If evaluation fails three times, the user must switch to a different mail item then switch back to retry evaluation.<br/><br/> However, administrators can override these evaluation limits by configuring the `ActivationAlertThreshold` and `ActivationRetryLimit` settings. For guidance on how to configure these settings, see [Evaluation response time for regular expressions in Outlook add-ins](../concepts/resource-limits-and-performance-optimization.md#evaluation-response-time-for-regular-expressions-in-outlook-add-ins).|
76
76
77
77
### Limits on the size of the item body evaluated
78
78
@@ -98,3 +98,4 @@ The following table lists the limits and describes the differences in the matche
98
98
99
99
-[Deploy and install Outlook add-ins for testing](testing-and-tips.md)
100
100
-[Privacy, permissions, and security for Outlook add-ins](../concepts/privacy-and-security.md)
101
+
-[Resource limits and performance optimization for Office Add-ins](../concepts/resource-limits-and-performance-optimization.md)
0 commit comments