I have tried drawing less number of rectangles, but i still get the errors The errors occur very randomly, so should i follow any work around to free the memory or something like that. Please do reply.

Anitha