Are you using run time memory allocation means heap memory?

If not try malloc/calloc for run time memory allocation, If problem is stil there try to find the compiler flag to increase the heap size.