calloc error: Not enough space

The program goes wrong when it runs for a about one day,the perror shows the message"Not enough space",but there are enough space for the program. I have no idea about the error,hoping for your help,Thanks!
calloc allocates contiguous memory. Which means if you have enough memory but its not contiguous it will fail.
calloc allocates contiguous memory
calloc allocates memory on stack which is severily limited in size. Common size is 1MB and could be less than that.

I was mistaken, looks like Yanson answer is close to truth.

What size your allocations are?
Last edited on
calloc allocates memory on stack which is severily limited in size.

Isn't calloc just like malloc except that calloc zero-initialize the memory?
Last edited on
You are right, i mixed up with alloca
Thanks Very much, I will try to use the memory pool to avoid the error!
Topic archived. No new replies allowed.