Page 2 of 2 FirstFirst 12
Results 21 to 21 of 21
  1. #21
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,501
    Rep Power
    5

    Default Re: OutOfMemory Error when read in pictures

    Sounds to me like you could do a couple of things.

    1. Load them lazily - i.e. as needed which I believe you were alluding too.
    2. And maintain a cache of them (sized for your needs).
    3. Consider using SoftReferences for storing the images. SoftReferences are guaranteed to be GC'd prior to any "out of memory exception" as long as
    there are no hard references to the same object. SoftReference (Java Platform SE 7 )


    Regards,
    Jim
    Last edited by jim829; 02-19-2014 at 12:42 AM.
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 3
    Last Post: 04-25-2013, 06:47 PM
  2. Replies: 22
    Last Post: 07-25-2012, 09:51 PM
  3. Replies: 1
    Last Post: 01-20-2010, 04:52 PM
  4. Replies: 7
    Last Post: 01-30-2009, 06:40 AM
  5. Replies: 16
    Last Post: 08-05-2008, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •