Skip to content

Commit e4abaf5

Browse files
committed
Few suggesstions
1 parent 966cdb6 commit e4abaf5

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

support/dynamics-365/field-service/mobile-app/webview-reset.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,26 @@ A WebView reset error while using Field Service Mobile indicates that the code w
1515

1616
## The Root Cause
1717

18-
A WebView reset occurs when the mobile operating system terminates an application process that is consuming too much memory. The threshold for "too much memory" varies by device and operating system and can affect how reliably the issue can be reproduced on a device. The WebView Reset error dialog is specific to iOS, which runs WebViews on separate, terminable processes outside of the core mobile application process. When this WebView process consumes more memory than the operating system tolerates, the WebView process is terminated. After the mobile system terminates the process to reclaim memory the mobile application detects the loss of the WebView and restarts it, showing a message to the user indicating a WebView Reset occurred. On Android, the WebView isn't run on a separate process so the entire application process is terminated, resulting in an application crash. WebView resets do not occur when using the application on a Desktop browser, however the memory pressure buildup can still be present and investigated in this context.
19-
It's important to be aware of the impact that poor memory management practices can have on the application experience as you author customizations within the application.
18+
A WebView reset occurs when the mobile operating system terminates an application process that consumes too much memory. The threshold for "too much memory" varies by device and operating system and can affect how reliably the issue can be reproduced on a device. The WebView Reset error dialog is specific to iOS, which runs WebViews on separate, terminable processes outside of the core mobile application process. When this WebView process consumes more memory than the operating system tolerates, the WebView process is terminated. After the mobile system terminates the process to reclaim memory, the mobile application detects the loss of the WebView and restarts it, showing a message to the user indicating a WebView Reset occurred. On Android, the WebView isn't run on a separate process, so the entire application process is terminated, resulting in an application crash. WebView resets don't occur when using the application on a desktop browser, however the memory pressure buildup can still be present and investigated in this context.
19+
20+
> [!IMPORTANT]
21+
> Poor memory management practices can affect the application experience when you create customizations.
2022
2123
## Memory Pressure
2224

2325
There are two common causes of memory pressure buildup to be aware of.
2426

25-
**Memory Spike** – A memory spike is when a large object is allocated into the WebView process and causes an immediate spike in memory usage. Examples can include storing Base64 representations of images and videos in variables within Power Apps Component Framework controls and Web Resources or utilizing JavaScript libraries that import large resource files like font libraries. If you can reliably reproduce a WebView reset through an action like opening a specific form or interacting with a specific control, you're likely encountering a memory spike.
27+
**Memory Spike** – A memory spike is when a large object is allocated into the WebView process and causes an immediate spike in memory usage. Examples include storing Base64 representations of images and videos in variables within Power Apps Component Framework controls and Web Resources or utilizing JavaScript libraries that import large resource files like font libraries. If you can reliably reproduce a WebView reset through an action like opening a specific form or interacting with a specific control, you're likely encountering a memory spike.
2628

27-
**Memory Leaks** – A memory leak is when memory is allocated within the WebView process but isn't cleaned up when no longer needed due to dangling pointers and references preventing garbage collection from reclaiming the allocated memory. This causes memory pressure buildup over time that can lead to a WebView reset. Examples include adding event listeners to the window object in Javascript but not removing them when navigating away. If you can't reliably reproduce a WebView reset and seem to experience them at random while doing different activities within the application, you're likely encountering a memory leak in the previous activities that you were performing before the reset.
29+
**Memory Leaks** – A memory leak is when memory is allocated within the WebView process but isn't cleaned up when no longer needed due to dangling pointers and references preventing garbage collection from reclaiming the allocated memory. This causes memory pressure buildup over time that can lead to a WebView reset. Examples include adding event listeners to the window object in JavaScript but not removing them when navigating away. If you can't reliably reproduce a WebView reset and seem to experience them at random while doing different activities within the application, you're likely encountering a memory leak in the previous activities that you performed before the reset.
2830

2931
## Debugging Memory Pressure
3032

31-
The WebView reset error itself is specific to iOS applications running WebViews and can only be reproduced within that context, however any code causing memory pressure on mobile causes memory pressure buildup on desktop browsers as well. This enables investigation of the root cause of a WebView reset using browser debug tools, like those provided by Microsoft Edge for tracking memory usage: [Fix memory problems - Microsoft Edge Developer documentation](/microsoft-edge/devtools-guide-chromium/memory-problems/)
33+
The WebView reset error itself is specific to iOS applications running WebViews and can only be reproduced within that context. However, code that causes memory pressure on mobile also causes memory pressure buildup on desktop browsers. You can investigate the root cause of a WebView reset by using browser debug tools, like those provided by Microsoft Edge for tracking memory usage. Learn more in [Fix memory problems - Microsoft Edge Developer documentation](/microsoft-edge/devtools-guide-chromium/memory-problems/).
3234

33-
These debugging tools are also available on mobile devices if needed: [Debugging JavaScript Code in Model-Driven Apps](/power-apps/developer/model-driven-apps/clientapi/debug-javascript-code)
35+
You can also use these debugging tools on mobile devices: [Debugging JavaScript Code in Model-Driven Apps](/power-apps/developer/model-driven-apps/clientapi/debug-javascript-code).
3436

35-
When debugging memory issues on iOS directly, Safari memory analysis tools enable you to identify the memory performance of the app module: [Timelines Tab](https://webkit.org/web-inspector/timelines-tab/)
37+
Use Safari memory analysis tools to check the memory performance of your iOS app module. Learn more in [Timelines Tab](https://webkit.org/web-inspector/timelines-tab/).
3638

3739
## Related content
3840

0 commit comments

Comments
 (0)