Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Everyone has good ideas. I like the idea of using <code>SoftReference</code>'s, although I'm not sure how often those get cleaned up, as this varies so much from VM to VM. You might want to combine that with regular <code>HashMap</code> to prevent you entire cache getting cleared every few minutes.</p> <p>EclipseLink has a few different cache implementations and <a href="http://wiki.eclipse.org/Introduction_to_Cache_%28ELUG%29#Cache_Type_and_Object_Identity" rel="nofollow noreferrer">pretty good documentation on them</a>. You could probably take advantage of a few ideas from the implementation (e.g., LRU, MRU, etc.). e.g.,</p> <ul> <li>hard cache</li> <li>soft cache</li> <li>combined hard/soft cache</li> </ul> <p>Since you're tuning a cache down to the nitty-gritty, I would recommend tuning it to different devices based on the hard specs. This is normally bad design, but the scope of the hardware that your software runs on mandates it, IMHO. e.g.,</p> <ul> <li>Detect the amount of available memory on the SD card. Most new smart phones come with multi-GB SD cards, and those are pretty hard to fill up with regular usage for most users. Use away! You can also detect the amount of space available on the SD card on startup, and increase/decrease the size of your cache on startup.</li> <li>Detect the amount of available memory and configure your caches with that in mind. If a user is using a hardware-intensive application, I don't think they'll mind that it makes up 200MB of RAM and provides a very fast user experience, especially since they spent a lot of money to have a phone that has 1-2GB RAM.</li> </ul> <p>Good luck!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload