title: How to maintain lists of 'currently most popular' items for each item category, in a web application?
body: <p>I need to maintain lists of 40 recent added, most popular/ most liked items for each item category(total categories around 2000) in my application. I  do store the views count &amp; no Of likes for each item. For that purpose, I'm looking to probably  maintain an in-memory structure on app server, to store &amp; retrieve these list of items. </p>
  
  <p>Do you have any ideas about how to implement this in-memory data structure, &amp; <em>importantly</em>, keeping in mind the associated memory footprint &amp; minimizing it to the farthest extent)? </p>
  
  <hr>
  
  <p>Using:</p>
  
  <p>Java 1.6</p>