web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / [offline powerapp] Wor...
Power Apps
Answered

[offline powerapp] Working around the heap memory limit for thousands of images

(0) ShareShare
ReportReport
Posted on by 29

Scenario - I have designed and developed a powerapp that is intended for offline use, where thousands of images (500Kb each) will be taken and stored on the mobile phone. The end user will go back to office and connect to wifi, then upload those images to sharepoint.

Problem - powerapps heap memory is 30-70Mb. Therefore it is not possible to load all images at once into a collection to send to the server. Even if I break up the images into multiple collections (chunks), they still need to be loaded into memory before they can be uploaded. Since I can't "loop" in powerapps, I am unable to free up memory after an image is uploaded.

Solution - 

  • Data collection - I have optimised the way I record photos, keeping a lightweight collection with references to the image but do not hold the image itself. Each image is stored locally using SaveData and then cleared from heap memory. 
  • Data uploading - I use get a list of all the image IDs, then check against Sharepoint which images are already there, then I upload only the images which are not yet uploaded. Even if it crashes mid way, this strategy ensures I can eventually load all images to the server.


However - There must be a better way?

Categories:
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    The 30-70Mb is total memory, including storage (using the classic offline method, not the new Dataverse-driven method that is in preview)

    How are you storing thousands of 500Kb images within that 30-70? Have you confirmed that you can store thousands?

    The App itself and its resources also take up part of the 30-70, and that 30-70 range is dependent on the device make, so you'd need to test the capabilities of the particular devices you intend to use with regards to how much they can store.

     

    "Each image is stored locally using SaveData and then cleared from heap memory."

    Can you expand on how you have implemented this?

  • power-apps-user Profile Picture
    29 on at

    If that is the case, then that is a very big problem for us. We need to be able to record thousands of photos at a time while offline. This limitation doesnt even make sense, powerapps should just give an option to store the photos natively on the photos app. With the right permissions etc.

    "Each image is stored locally using SaveData and then cleared from heap memory." - what I mean here is to use SaveData on every image, then clear it from the 'Collection'. So it is out of the RAM.

    The Bottom Line - does that mean powerapps is not the right tool for this job ? And I should go back to a web browser or native app solution ?

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    The storage for Power Apps offline using the old method (that you are using) has limitations - there is a newer offline method that is in preview, which uses a version of SQL-lite to store Dataverse tables locally, but it has different limitations in that it doesn't work well with images currently.

     

    So in terms of your question - yes for this particular solution Power Apps is not the right tool.

  • power-apps-user Profile Picture
    29 on at

    Is there any documentation on what the 'newer offline method that is in preview' offers and what are the limitations for images ? 

    If it is possible to make it work for large amount of images, even if I need to duct tape stuff together, it would give us the lead time to find a proper solution.

     

    A possible solution is - turn images into JSON representation, then save it as string into the offline dataverse. Would this work? Is there any size limit to the offline dataverse?

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hey sorry for some reason this reply didn't notify me - there's some more details here:

    Mobile offline for canvas apps (preview) - Power Apps | Microsoft Learn

     

    It's in Preview though, so I wouldn't personally use it for anything Prod - just my personal opinion 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard