pdfrx icon indicating copy to clipboard operation
pdfrx copied to clipboard

iOS Memory Crash (EXC_RESOURCE) with High Memory Usage in Flutter App

Open abbashosseinii opened this issue 1 year ago • 0 comments

The app crashes on iOS devices due to exceeding the memory limit (1450 MB). The crash occurs in the pdfrx package when processing large files. Android works fine, but iOS fails with the following error:

* thread #35, name = 'DartWorker', stop reason = EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=1450 MB)
    frame #0: 0x0000000102e3baf4 pdfrx`CStretchEngine::ContinueStretchHorz(this=0x0000000284436630, pPause=0x0000000000000000) at cstretchengine.cpp:325:5 [opt]
Lost connection to device.

Steps to Reproduce:

  1. Run the app on an iOS device.
  2. Perform [specific action, e.g., load a large PDF file].
  3. The app crashes with the above error.

Environment:

  • Flutter Version: 3.24.3
  • iOS Version: 15.8.3
  • Device: iphone 6s plus
  • Package: pdfrx: ^1.0.101
  • Build Mode: Debug

abbashosseinii avatar Feb 15 '25 14:02 abbashosseinii