Hi Team, We are using Starrocks in a shared-data m...
# questions-and-troubleshooting
a
Hi Team, We are using Starrocks in a shared-data mode with an external iceberg table (hive metastore as iceberg catalog). We have been using the cluster for sometime and the FE memory keeps on gradually increasing. (Mostly because of
enable_iceberg_metadata_cache=true
) But its not practical to increase the FE memory. We started with
Xmx=20G
and now we are amlost at
Xmx=40G
. What are the best practises here? Found some related issue on github. We have a similar memory usage pattern https://github.com/StarRocks/starrocks/issues/47630 TIA
a
Currently, the metadata doesn’t support spill into disk. The only method is to increase the memory capacity now.
a
Any suggestions on expiring cache so that we can control the FE memory?
a
What’s your starrocks version?
a
3.4+
but if there are fixes in the later versions we can upgrade as well
a
In 3.4, it has support disk cache
image.png
You can enable it in the
fe/conf/fe.conf
The expiration in memory is controlled by
iceberg_metadata_memory_cache_expiration_seconds
a
This is all very helpful, thank you so much for your help @Allen Li
@Allen Li one follow up question,
iceberg_metadata_memory_cache_capacity
this config defaults to
512 MB
, then how is cache growing to GBs?
е
the issue is that there are 2 caches, one is cache of iceberg manifests and other metadata, https://github.com/StarRocks/starrocks/blob/e0dcdbabe07b9ab18730c8a5fda487ff7b7c6e[…]va/com/starrocks/connector/iceberg/io/IcebergCachingFileIO.java it is controlled by iceberg_metadata_disk_cache_capacity and iceberg_metadata_memory_cache_capacity and then there is https://github.com/StarRocks/starrocks/blob/e0dcdbabe07b9ab18730c8a5fda487ff7b7c6e[…]java/com/starrocks/connector/iceberg/CachingIcebergCatalog.java that has a bunch of maps that a not controlled in size and are leaking perhaps
a
so this means that even if we use
iceberg_metadata_memory_cache_expiration_seconds
or
iceberg_metadata_memory_cache_capacity
is will only clear the caches maintained by IcebergCachingFileIO.java, but the caches created in CachingIcebergCatalog.java will still be unbounded (which probably are the ones causing the huge increase in memory)? Extending that thought will it be the same for the disk-cache as well?
е
yes
a
will go through this class and check once. Thanks for this information
I tried this
Copy code
CREATE EXTERNAL CATALOG `iceberg`
PROPERTIES (
"iceberg_meta_cache_ttl_sec"  =  "3600",
"s3.region"  =  "us-west-2",
"aws.region"  =  "us-west-2",
"iceberg_manifest_cache_max_num"  =  "10000",
"hive.metastore.uris"  =  "thrift://metastore:9083",
"type"  =  "iceberg",
"iceberg.catalog.type"  =  "hive",
"iceberg_table_cache_ttl_sec"  =  "3600"
)
iceberg_meta_cache_ttl_sec
is used in
CachingIcebergCatalog
. Default value for this is 2 days. I reduced it to 1 hour but at the moment do see any periodic reduction is JVM. Any thoughts as to what could possibly be the reason
a
Could you mind to submit an github issue and give an reproducible case?
a
Sure. Let me create one.
a
Thanks.
g
@Arun Dhingra What is the GH issue for this one?
a
We actually upgraded to starrocks
3.4.5
. That partially solved the issue (we were originally on
v3.4.0
. For us the checkpointing was not happening, but post the upgrade that started working fine. The JVM memory is still high, but in our case that is partially attributed to high number of MVs that we are creating. The iceberg metadata cache size still exists though.
Have not created an issue for this, will create one