add window function memory reduction