Hi Mariam,

1. The expired state object will be cleaned up when it is accessed in a read 
operation. And for the expired state that is never accessed again, there are 
three strategies to remove it in the background: FULL_STATE_SCAN_SNAPSHOT, 
INCREMENTAL_CLEANUP, ROCKSDB_COMPACTION_FILTER.
2. FULL_STATE_SCAN_SNAPSHOT: When a full snapshot for checkpoint or savepoint 
is taken, the expired state will be evicted automatically. The strategy is 
supported in 1.6.0. 
3. INCREMENTAL_CLEANUP: This strategy is specific to Heap state backends. If 
enabled it, every state access triggers a cleanup step. For every clean up 
step, a certain number of state entries are checked for expiration. 
4. ROCKSDB_COMPACTION_FILTER: This strategy is specific to Rocksdb 
statebackend. The strategy will register a Flink specific compaction filter to 
RocksDB, and the expired state data will be cleaned up during the compaction 
process of RocksDB.

For more information, you can refer to this page: 
https://flink.apache.org/2019/05/19/state-ttl.html

Best regards,
Jinzhong, Li


On 2022/01/09 08:41:08 Mariam Walid wrote:
> Dear All,
> 
> I am writing to inquire about the state time to live lazy removal. I guess
> that even if the state has expired it i still in the memory and not garbage
> collected. The question is how to get rid of those expired states.
> 
> Best regards,
> Mariam
> 

Reply via email to