• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird : Data class : does my cache need to be memory-sensitve?

 
Calen Legaspi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm caching the records from the file into memory. Now the file issued with URLyBird only has around two-dozen records, so all of those could undoubtedly be accomodated into memory.
Now, my question is, does my app have to accomodate for a time when the entire database cannot fit into memory? Meaning, should I write my database-managment classes such that it is memory-sensitive, perhaps using SoftReferences, such that when memory starts to get scarce the garbate collector is able to delete entries?
Or is that overkill, and a simple HashMap will do for a cache?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Calen
Welcome to JavaRanch.
Could you please change your displayed name to meet the JavaRanch naming policy? You can change it here. We just need a last name displayed (or something that could be your last name, if you dont want to have a large last name displayed).
There have been a few discussions in the past about this. Generally those people who are cacheing the data in memory are of the opinion that it should be reasonable to do this, since the records are so small. By the time you have enough records in memory for it to start becoming an issue, you should have moved away from the home built database and gone to a professional database.
Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic