public void gc ( ) { List < Integer > toRemove = new ArrayList < Integer > ( ) ; for ( Integer transponder : decoderData . keySet ( ) ) if ( decoderData . get ( transponder ) . posDec . getLastUsedTime ( ) < latestTimestamp - 3600000 ) toRemove . add ( transponder ) ; for ( Integer transponder : toRemove ) decoderData . remove ( transponder ) ; }
Clean state by removing decoders not used for more than an hour . This happens automatically every 1 Mio messages if more than 50000 aircraft are tracked .