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

Memory leak issue in IOS when open large PDF file #516

Closed
wasimbakali opened this issue Sep 2, 2019 · 13 comments
Closed

Memory leak issue in IOS when open large PDF file #516

wasimbakali opened this issue Sep 2, 2019 · 13 comments
Milestone

Comments

@wasimbakali
Copy link

Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x] Bug report -> please search issues before submitting
- [ ] Feature request
- [] Documentation issue or request

Hi There,

I am trying to open large PDF in my ionic 3 angular 5 project its working fine in browser but in IOS when i try to open large PDF (more than 100 MB) it gets open but after few seconds screen gets white and app gets refresh.

I found below log just before screen gets white.

[ProcessSuspension] 0x1c5c710c0 - ProcessAssertion() Unable to acquire assertion for process with PID 0

also i googled this error and found that this can be happen when app try to occupy much memory.

Is there any way to open large file without memory leak ?

Thanks in advance!

@VadimDez VadimDez added this to the 6.0.0 milestone Oct 15, 2019
@VadimDez
Copy link
Owner

@gamalshaaban1986
Copy link

i am still having the same problem in IOS even after upgrading library, can any one help please

@VadimDez
Copy link
Owner

@gamalshaaban1986
Copy link

yes , unfortunately the same problem, i think memory is not freed . the scenario i am facing is when trying to open files consequently, it works fine with the first one , then crashes on the next .is there any way to force freeing resources allocated in memory?

@VadimDez
Copy link
Owner

@gamalshaaban1986 before I'll dig into this problem you can try to hide and then show the component - this hack might help for now...

@gamalshaaban1986
Copy link

gamalshaaban1986 commented Oct 19, 2019

Actually i didn't get understand what do you mean,

my html for your reference

<pdf-viewer [src]="pdfSrc" style="display: block;" [zoom]="pdfZoom" [rotation]="rotation"
[original-size]="false" [show-all] ="false" [page]="page"
(after-load-complete)="afterLoadComplete($event)" >

@gamalshaaban1986
Copy link

did you mean adding *ngIf="isShown"?

@VadimDez
Copy link
Owner

Could you try the latest version 6.0.1? Also don't forget about breaking change. pdf-viewer container now should be scrollable for the best performance. https://github.com/VadimDez/ng2-pdf-viewer/blob/master/CHANGELOG.md#breaking-change

@gamalshaaban1986
Copy link

Thank VadimDez,
I had tried but for sorry the same memory leak exists

@htruong24
Copy link

I got the same issue, do we have any temporary solution?

@VadimDez
Copy link
Owner

@htruong24 You could try to do what it says here and make the pdf container scrollable, so that it doesn't render all the pages.

@seopei
Copy link
Contributor

seopei commented Jun 28, 2020

I have the same issue. I am using Ionic 5 and the latest version of ng2-pdf-viewer. I made the pdf container scrollable.

@gigallo
Copy link

gigallo commented Feb 9, 2022

Hi

We have the same problem using version 7.0.1 and viewing a file of less then 1MB.

Just one second before white page we can trace this log:

2022-02-09 02:24:42.894789-0800 App[1460:141238] [XPC] Handle connection with error: Connection interrupted 2022-02-09 02:24:42.927341-0800 App[1460:141238] [ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke 2022-02-09 02:24:43.192994-0800 App[1460:141087] [Process] 0x1075bc600 - [PID=1465] WebProcessProxy::didClose: (web process 0 crash) 2022-02-09 02:24:43.195157-0800 App[1460:141087] [Process] 0x1075bc600 - [PID=1465] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=4 2022-02-09 02:24:43.198158-0800 App[1460:141087] [ProcessSuspension] 0x1075d6760 - ProcessAssertion: Failed to acquire RBS Background assertion 'ConnectionTerminationWatchdog' for process because PID is invalid 2022-02-09 02:24:43.199106-0800 App[1460:141423] [ProcessSuspension] 0x1075d6760 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=0, error: (null) 2022-02-09 02:24:43.210215-0800 App[1460:141087] [Process] 0x101823c18 - [pageProxyID=5, webPageID=6, PID=1465] WebPageProxy::processDidTerminate: (pid 1465), reason 4 2022-02-09 02:24:43.334134-0800 App[1460:141423] [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}> 2022-02-09 02:24:43.334259-0800 App[1460:141423] [ProcessSuspension] 0x1075d67c0 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=1465, 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} 2022-02-09 02:24:43.382068-0800 App[1460:141087] [Loading] 0x101823c18 - [pageProxyID=5, webPageID=6, PID=1465] WebPageProxy::dispatchProcessDidTerminate: reason=4 To Native Cordova -> Device getDeviceInfo Device599886057 ["options": []] To Native Cordova -> File requestAllPaths File599886058 ["options": []] To Native Cordova -> CordovaHttpPlugin setServerTrustMode CordovaHttpPlugin599886059 ["options": [pinned]]

Any help?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants