I have a bash script that loops through the results of find for a directory containing hundreds of subdirectories and thousands of files and runs a number of commands on each file, mostly sed and grep.
I understand that this obviously computationally intensive. The problem I'm running into is that it uses a ton of memory which isn't freed up when the script is finished. This script is running inside of cygwin. Closing cygwin does not free up any memory, I need to reboot Windows to get it back.
Is there a command I can run (either in Windows or cygwin) to free up memory used by the script?
purgein cygwin. Works in Linux.purge? What is it? There is no such utility in Debian repository. To clear FS cache on GNU/Linux you may use# sync && echo 3 > /proc/sys/vm/drop_cachesbash ./script, all memory should be given back to the system after the bash-process ends, except (a) cygwin/bash has serious bug or (b) not all subprocesses started are actually really gone. Which measure exactly are you using that lets you know your RAM is all taken and no longer recoverable by Windows?