Reduce working memory allcation size during prepare histogram
Prevent memory access violation