Hi Shaosu,
Do you have an estimate on the total size of state you are keeping for the windows? How many messages/sec, how large a window, message size, etc would be good details to include.
Also, which state backend are you using? Have you considered using the RocksDB state backend. This backend will spill Flink state to disk if it's larger than available RAM. You'll also probably want to use "fully async" mode for the RocksDBStateBackend.
-Jamie