Friday, April 10, 2009

FragmentCache part duex: Cleaning

I realized that I forgot to address an additional, critical, issue with fragment caching: cleaning out expired fragments.  A fragment cache implemented as I described in my last post would update expired fragments when requested, but what about expired fragments that aren't requested?  

If you externalized the cache itself, then your cache will likely support LRU or LFU expiration policies. But, if you're using a in-memory cache in the Java heap space, well, that's a memory leak.  If you cache a lot of fragments, failing to clean the cache is a recipe for maxing out the old generation space and thus causing Full GC's to run back-to-back, collecting just enough space to limp along, but not do any good, until eventually your application becomes non-responsive.  So, an additional requirement for an in-memory fragment cache is that you monitor the usage and have a cleaner task which runs, say, once an hour, to remove fragments that have expired and are not currently locked for update.  Doing this efficiently with a large cache requires using a data structure that supports thread-safe concurrent access, so as to avoid locking the whole cache while cleaning and maintain high throughput.  


best thesis writing service said...

NET MVC 5 Authentication Breakdown : Part Deux. .... on a www page that displays product categories with the help of Page Fragment Cache. said...

insanity workout
louis vuitton outlet stores
adidas originals
michael kors outlet
coach factory outlet
replica watches
toms shoes
gucci handbags
louis vuitton handbags
coach outlet store online
timberland outlet
louis vuitton handbags
kate spade outlet
oakley sunglasses
oakley sunglasses
cheap jordans
oakley vault
burberry bags
air jordans
coach outlet store online clearances
beats solo 2
lebron james shoes
coach outlet store online
tory burch outlet
adidas ultra boost
cheap ray ban sunglasses
hollister shirts
ralph lauren polo
coach outlet store online clearances

aaa kitty20101122 said...

michael kors outlet store
harden shoes
louboutin shoes uk
yeezy boost 350
michael kors outlet
adidas online shop
nike football boots
led shoes
adidas nmd
adidas stan smith shoes

aaa kitty20101122 said...

cartier bracelet
air yeezy
air jordan 13
louboutin shoes uk
adidas gazelle
air jordan shoes
michael kors handbags
curry 3

dong dong23 said...

adidas wings shoes
oakley sunglasses
nhl jerseys
oakley sunglasses wholesale
christian louboutin uk
discount nike shoes
cartier sunglasses
ugg boots clearance
rolex datejust 2
hermes belt

chenlili said...

longchamp outlet
juicy couture outlet
uggs outlet
basketball shoes
canada goose outlet
coach outlet online

dong dong23 said...

air max
kate spade
mont blanc pens
nike pas cher
mulberry handbags
occhiali oakley
birkin bag
true religion outlet
parajumpers Outlet

Love Kpop said...

There are times when I find it difficult to make decisions, but still have to do. I know people always have emotions so that there is no justice. But I still hope.

洛噷 said...

2018930 leilei3915
mont blanc
pandora charms sale clearance
michael kors outlet online
canada goose jackets
fitflop sandals
ray bans
mbt outlet
supreme clothing uk
polo ralph lauren
pandora charms sale clearance