An innovative application I developed utilizes Nuxt.js (SPA) to efficiently process up to 20 images captured with an iPhone in one go. Upon capturing the images, they are compressed to roughly 500KB using a library known as browser-image-compression and then displayed in a preview format.
The challenge arises when attempting to register 20 photos simultaneously, causing the Nuxt.js application to suddenly crash mid-process. The captured image starts to disappear after loading, resembling a reloading scenario, hinting at a potential memory leak issue.
In an effort to diagnose the problem, I monitored the memory usage using Mac Safari's timeline feature but observed a continuous increase in memory consumption with each shot without any decrease.
One attempt to address this was by refreshing the memory using location.reload(true)
, although it did not result in reduced memory usage. Your insights on how to effectively manage memory refresh or prevent the application from crashing would be greatly appreciated.
For reference, you can view the Memory Timeline just before the crash.
Versions
- iPhone 11
- iOS 14.6
- @nuxt/cli v2.14.12
- Vue v2.6.14
- browser-image-compression v1.0.14