Interest of initialCapacity in CCache ?

47 views
Skip to first unread message

Nicolas Micoud

unread,
May 5, 2022, 3:40:11 AM5/5/22
to iDempiere
Hi,

I'm implementing cache on a specific cache and I was wondering what should be the best initialCapacity value.
After looking at other examples, I choose 50.
And then, I wanted to know what is the difference between setting to 10 or 100.
And I think, there is no as the initialCapacity parameter is never used whereas is present in vert constructor.

Wondering if the parameter should be removed, marked as useless or used?

wdyt?

Nicolas

Carlos Antonio Ruiz Gomez

unread,
May 11, 2022, 2:03:16 PM5/11/22
to idem...@googlegroups.com
I arrived to the same conclusion when working on this pull request
https://github.com/idempiere/idempiere/pull/1325

Just marked the parameter as // ignored in the javadoc, but as all those
are public methods is better not to remove the useless variable.

A better possibility would be to implement the initial capacity in the
definition of MaxSizeHashMap (CacheMgt:135).

I don't know if hazelcast support initial capacity (it seems it
doesn't), but is not very important the distributed caches are just a few.

Regards,

Carlos Ruiz


El 5/5/22 a las 9:40, Nicolas Micoud escribió:
Reply all
Reply to author
Forward
0 new messages