I have a program that goes n^2 layers deep of recursion and mallocs a bunch of memory to concatenate char*s together. With a large enough n, the process just gets killed by the server (since it is consuming too much memory). How can I release this memory and still have my data?
It's mallocs look like
test = (char *)malloc(sizeof(char) * 256);
I need this data straight until the end of the program. How can I deal with this?