ticket VS-146
fix issues with memory allocation failed