Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Possible memory leak causing web view reload when downloading large files (images and videos) through the proxy #23

Open
fortinmike opened this issue Dec 14, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@fortinmike
Copy link

When our app starts, it fetches a lot of images and videos, about 100-200 MB total, in one go. While this occurs (only when proxying requests using cordova-plugin-webview-proxy), native app memory usage goes up, then the web view crashes and reloads when it reaches a certain point (~120-160 MB).

Here is the native console log output that appears when this occurs:

2021-12-14 12:24:27.381203-0500 App[2436:466287] [Process] 0x102cc8c00 - [PID=2447] WebProcessProxy::didClose: (web process 0 crash)
2021-12-14 12:24:27.381296-0500 App[2436:466287] [Process] 0x102cc8c00 - [PID=2447] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=4
2021-12-14 12:24:27.381361-0500 App[2436:466287] [ProcessSuspension] 0x102cf81e0 - ProcessAssertion: Failed to acquire RBS Background assertion 'ConnectionTerminationWatchdog' for process because PID is invalid
2021-12-14 12:24:27.381517-0500 App[2436:466287] [Process] 0x15883c418 - [pageProxyID=11, webPageID=12, PID=2447] WebPageProxy::processDidTerminate: (pid 2447), reason 4
2021-12-14 12:24:27.385477-0500 App[2436:466287] [Loading] 0x15883c418 - [pageProxyID=11, webPageID=12, PID=2447] WebPageProxy::dispatchProcessDidTerminate: reason=4
2021-12-14 12:24:27.387126-0500 App[2436:467004] [ProcessSuspension] 0x102cf81e0 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=0, error: (null)
2021-12-14 12:24:27.392717-0500 App[2436:467004] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
2021-12-14 12:24:27.392875-0500 App[2436:467004] [ProcessSuspension] 0x102cf8240 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=2447, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}

Seems like the proxy is leaking something, but I'm not sure what at the moment. Any ideas?

To Reproduce

  1. Fetch some amount of large files using the proxy
  2. Watch memory usage
  3. Memory constantly goes up until the web view reloads

Expected behavior
Not leaking / reloading.

@fortinmike fortinmike added the bug Something isn't working label Dec 14, 2021
@fortinmike fortinmike changed the title [BUG] Memory leak causing web view reload when downloading large files (images and videos) through the proxy [BUG] Possible memory leak causing web view reload when downloading large files (images and videos) through the proxy Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant