# State TTL in Flink 1.8.0: How to Automatically Cleanup Application State in Apache Flink

DevFeed: [State TTL in Flink 1.8.0: How to Automatically Cleanup Application State in Apache Flink](<https://devfeed.tech/articles/state-ttl-in-flink-1-8-0-how-to-automatically-cleanup-application-state-in-apache-flink-48339.md>)

Original publisher: [Read original article](<https://flink.apache.org/2019/05/17/state-ttl-in-flink-1.8.0-how-to-automatically-cleanup-application-state-in-apache-flink/>)

Published: 2019-05-17T12:00:00Z

Content type: article

Language: en

Sources: [Apache Flink® -- Stateful Computations over Data Streams on Apache Flink](<https://devfeed.tech/sources/apache-flink-stateful-computations-over-data-streams-on-apache-flink.md>)

Topics: [apache-flink](<https://devfeed.tech/topics/apache-flink.md>), [flink](<https://devfeed.tech/topics/flink.md>), [Stateful](<https://devfeed.tech/topics/stateful.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [sensitive data](<https://devfeed.tech/topics/sensitive-data.md>)

Tags: [apache-flink](<https://devfeed.tech/tags/apache-flink.md>), [flink](<https://devfeed.tech/tags/flink.md>), [gdpr](<https://devfeed.tech/tags/gdpr.md>), [state](<https://devfeed.tech/tags/state.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [ttl](<https://devfeed.tech/tags/ttl.md>)

## AI overview

This article explains Apache Flink's State TTL feature for automatically expiring application state. It covers state-size management, streaming application use cases, configuration, internal TTL management, background cleanup introduced in Flink 1.8.0, and data-protection requirements such as GDPR.

## Source excerpt

A common requirement for many stateful streaming applications is to automatically cleanup application state for effective management of your state size, or to control how long the application state can be accessed (e.g. due to legal regulations like the GDPR). The state time-to-live (TTL) feature was initiated in Flink 1.6.0 and enabled application state cleanup and efficient state size management in Apache Flink. In this post, we motivate the State TTL feature and discuss its use cases.