Skip to content

[syncfusion_flutter_pdfviewer] Out of Memory on large PDF FilesΒ #2433

@francescovallone

Description

@francescovallone

Bug description

When using the library on an iPad and attempting to load a large PDF file (300 MB), the application crashes or freezes completely.
The difference in behavior is related to the use of .file or .memory.

In both cases, the problem is related to the fact that the 300 MBs are instantly added to the heap stack, causing the application to run out of memory.

I also tried to stream the content of the file to the viewer but it failed miserably 😒

Steps to reproduce

Use .file or .memory named constructor to create a PdfViewer and load a large file (300MB)

Code sample

Code sample
[Add your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Stack Traces

Stack Traces

On which target platforms have you observed this bug?

iOS, Android

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 3.32.8, on macOS 15.4.1 24E263 darwin-arm64, locale it-IT)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[βœ“] Xcode - develop for iOS and macOS (Xcode 16.3)
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 2024.3)
[βœ“] VS Code (version 1.103.2)
[βœ“] Connected device (3 available)
[βœ“] Network resources

β€’ No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions