I have a thread logging variables' values to a file, something similar to this:
fp = fopen("log.txt", "a");
fprintf(fp, "%d,", var1);
fprintf(fp, "%d,", var2);
fprintf(fp, "%d,", var3);
...
fprintf(fp, "\n");
fclose(fp);
I noticed that MemFree in /proc/meminfo is rapidly decreasing, I suspect because of my output being buffered. To my suprise, MemFree is not recovered after killing the process. This lead me to these questions:
- Can having low (or no) MemFree cause issues?
- How can I avoid "loosing" memory?
Thank you in advance.