July 23, 2004

Flyweight Pattern in use

On another note, I was able the other day to play around with a proof of concept at work related to the caching problems we have been having. Part of the problem is the sheer amount of data we have stored in reference tables that we would like to be able to cache, but the memory requirements with the current caching scheme are just immense. A couple of weeks ago, I stumbled across an article introducing me to the Flyweight pattern of storing pointers to one copy of an object, instead of creating a new object that has (at least) the same base data and blowing the memory out of the water. This proved to be very effective in our situation, cutting the memory requirements for our current cache by more than 50%, and allowing me to cache a huge table (2 million records) that I was previously unable to cache. That memory requirement was cut by 80%.

Now I just need to share my findings with the larger group, and hopefully, they will be implemented.

Posted by doug at July 23, 2004 11:10 AM
Comments
Post a comment









Remember personal info?