items tagged with caching
Written By: Administrator
Section: Java
Category: Tuning
2007-10-19 16:56:18
Still not enough, we were forced to profile the java code and make some big changes.... (from part 1)
Profiling
You either profile an application for speed and/or memory usage
and/or memory leaks. Our application is fast enough at the moment. Our
major concern is optimizing memory usage and thus avoiding
disk memory swapping.
Some words about architecture
It is not possible to profile any applications without having a deep
understanding of the architecture behind. The Product Catalog is an
innovative product which is a meta model for storing insurances product
in a database, a Product is read only and can derivate
instance that we call Policies. Policies are users data holder,
containing no text, just values, and sharing a similar structure as the
Product. This let the product know everything about (cross) default
values, (cross) validations, multiple texts, attributes
order/length/type
etc... and thus separate definition (Products) from implementation
(Policies). Products and Policies can be fully described with
Bricks, Attributes in a tree manner.
Reduce the number of object created
Looking at the code, we have seen that too many Products
(17 Products has 15000 objects either
Attributes/Bricks/Texts/Value/ValueRange) were loaded in
memory. While this is clearly giving a speed advantage on an
application server, it is simply killing the offline platform with it
1GB RAM (remember memory really free is 500Mb)
The problem is that Attributes and Brick are using/can use a lot
of fields/meta data in the database which translate into simple java type
(String for UUID, and meta data keys and values) in memory. We
start looking at the profiler and the 100 MB used by the product cache.
Reducing this amount of object was the first priority, a lot of them
are meta data which are common and spread across the Product Tree in
memory. Since avoiding creation of unneeded object is always
recommended, we decide to remove duplicate element in the tree by singularizing
them. This is possible because the product is Read Only and made of
identical meta data keys, meta keys value.
Read More About Enterprise Grade Performances Tuning With Critical Memory Constraints (Part 2)...
There are 1 items tagged with caching. You can view all our tags in the Tag Cloud

















