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.  

8 comments:

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.

xjd7410@gmail.com 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
chenyingying20160806

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...

nmd
cartier bracelet
air yeezy
air jordan 13
louboutin shoes uk
adidas gazelle
longchamp
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
2017.9.15chenlixiang

chenlili said...

longchamp outlet
fitflops
juicy couture outlet
uggs outlet
ugg
basketball shoes
canada goose outlet
coach outlet online
louboutin
louboutin
201712.7chenjinyan

dong dong23 said...

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

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.
www.facebookbaixargratis.com.br