推荐:揭穿J2EE架构中In-process Cache的真相

03-04-30 banq
什么叫In-process Cache?
因为对象的创建和销毁会耗费时间,将这些对象保存在处理过程中的内存中,这样避免频繁的创建和销毁。这样可以快速提高系统的性能。

但是本篇文章认为,这种In-process Cache反而是对应用性能是有害的。

http://www.theserverside.com/news/thread.tss?thread_id=19001

[该贴被admin于2008-10-17 16:46修改过]

cute
2003-04-30 16:16
对象不摧毁! 而要保留在内存中。 作为一个购物系统,他会影响到系统性能(需要一定的空间去容纳他们)。我想如果需求速度的话,这样是不错的 。

Jevang
2003-05-01 14:17
There is a very good discussion thread on www.theserverside.com about this article, after reading thru, your can tell general response is not very positive about this.

Based on my personal opionion, unless you can caching piles of data, in process cache have very little impact on GC, cache is "non transient" memory, as long as it remain as a small portion of total memory, it has almost no negative effect on GC frequence, its impact on GC( full GC) duration are normally not significant.

On the other side, frequent serailziation due to bring in data from external cache will increase consumption of more transient memory, and that's a GC and performance killer.

any, once you know the artifacts, it's just a simple mathematic thing to figure out whether local or external cache it's good or not for your project.

Cheers
-Wanchun