Decrease window size for better adapting to current used Spark cluster size to prevent running out of memory.
Spark streaming continues to receive data from InputDStream and produce RDDs. If your Spark cluster has no enough computing resources to promptly consume all RDDs from input stream. These RDDs would block in the memory of worker nodes and at the end cause the failure of "out of memory."