title: State garbage collection in Beam with GlobalWindow
body: <p>Apache Beam has recently introduced <a href="https://beam.apache.org/blog/2017/02/13/stateful-processing.html" rel="nofollow noreferrer">state cells</a>, through <code>StateSpec</code> and the <code>@StateId</code> annotation, with partial support in Apache Flink and Google Cloud Dataflow.</p>
  
  <p>I cannot find any documentation on what happens when this is used with a <code>GlobalWindow</code>. In particular, is there a way to have a "state garbage collection" mechanism to get rid of states for keys that have not been seen for a while according to some configuration, while still maintaining a single all-time state for keys are that seen frequently enough?</p>
  
  <p>Or, is the amount of state used in this case going to diverge, with no way to ever reclaim state corresponding to keys that have not been seen in a while?</p>
  
  <p>I am also interested in whether a potential solution would be supported in either Apache Flink or Google Cloud Dataflow.</p>
  
  <p>Flink and direct runners seem to have some code for "state GC" but I am not really sure what it does and whether it is relevant when using a global window.</p>