Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7066203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:03:20+00:00 2026-05-28T05:03:20+00:00

I am currently downloading 471 thumbnails from a server,doubling the dimensions,saving it on the

  • 0

I am currently downloading 471 thumbnails from a server,doubling the dimensions,saving it on the device and using the TableLayoutManager with custom image fields to display them. However, I think that creating these extra 471 custom image fields is causing a huge memory leak.

I monitored the memory usage while it was downloading and it only increased slowly to about 10-18 mb before the garbage collector kicked in,so it is fine.However, once all the thumbnails are cached on the phone,it uses about 100+ megabytes to read the images from the disk,double them in size,create the 471 custom image fields and display them. The total size of the 471 thumbnails is 427 kb. How could the system use that much memory to load those files?

However, If I where able to use a listfield like a tablelayoutmanager then it would I wouldn’t have to create those extra 471 custom image fields and just directly add the images to the listfield.

Has anyone had to do something similar or have an example on how to achieve a table like format using a listfield?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:03:21+00:00Added an answer on May 28, 2026 at 5:03 am
    1. The 427kb is the download size of the PNG images. PNGs are compressed. When you open them up in memory they actually expand, so that each pixel in the image, could contain up to 4 bytes (ARGB) values (depending on the format) and also other PNG metadata.

    2. Saving the thumbnails with double the size (dimensions), will not necessarily yield a file size with double size. It could be larger or smaller, depending on the image and how good the image compressor is.

    3. Adding images directly to the list field won’t make any difference. You still will have them loaded in memory. What you need to do is have some sort of manageable in memory cache of say 20 images maximum. Your code needs to be clever enough to detect where in the list field the user is at any moment, and display images for that view.

    So, let’s say each list field object (or row) has a tag associated with the respective image (e.g. filename). Once the user has finished scrolling up/down, you can then load the images for that view. If the first row displayed in the list field is row 20 and you can display 8 items, you will need to grab images 20 – 28 and load them in to the in-memory cache if they are not already there (so check the cache first). Then call invalidate() on the list field to ensure it repaints.

    Threading:

    a) You won’t need a thread to detect where the user is at any point. You should be able to use the moveFocus methods or navigation methods and figure out where the user is.

    b) For loading images you need a queuing mechanism. Task queues are quite simple to implement, once you get your head around the threading/locking mechanism. Each task in the queue will load the image in it’s own thread.You will want to set a limit of how many tasks (threads) are active in the queue at once. I would go for 3-5 maximum (this is from experience on BB platforms). For queue implementations I would suggest by reading up about task/job queues, and producer/consumer problems.

    The above mechanism is used a lot. This is why when you scroll down a contacts list for example, you might see a slight delay before the image of the contact is loaded and rendered next to the contact name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently downloading and caching several different data sets from my server. However
I'm currently downloading an .mp3 file from a remote server and once the file
I'm currently downloading an HTML page, using the following code: Try Dim req As
I need help with downloading from webserver... What i currently do is get XML
Currently I am downloading and parsing my data from an XML file that is
I am dealing with huge data (downloading from webserver to client/phone). Currently I am
My app is downloading packages of images from a server. It's an array of
I'm currently trying to create a gallery of pictures loaded from Internet. I'm using
I am using the SQL Server Report Server from Microsoft SQL Server 2005. In
In an iPhone app I currently have code for downloading a file from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.