Followers

Thursday, June 13, 2013

JVM parameter TLASIZE

A short background on TLA-sizing:

A TLA is a chunk of memory where a thread can do fast object allocation. Only objects that are small enough to fit in the TLA can be allocated there. This means that increasing the TLA size allows you to allocate larger objects in the TLAs. On the other hand, if you are using a nursery, all TLAs come from the nursery. This means that you can get fewer TLAs from the same sized nursery if you use a larger TLA size. Also, threads that don't allocate much get the same TLAs as other threads, which potentially wastes memory if they can not fill the TLAs.

In your case you get 500/8 = 62 TLAs from your nursery as opposed to 500/0.256 = 1953 TLAs if you would have used the default value (256k) for TLA size.

So, a large TLA size may mean that you can allocate larger object in TLAs (and thus in the nursery as opposed to in old space) but it may also increase the YC frequency.

You mention that all of you objects are about the same size. What size is that? I think it would be wise to make sure that the TLA size is large enough to fit those object in, but the TLA size should not be too large.

My feeling is that 8 MB is quite a large size for TLAs. There is a way to specify a range for the TLA size. You can set a minimum value and a preferred size. This allows for more dynamic (and hopefully more efficient) TLA sizing.

-XXtlaZize:min=2k,preferred=256k