phb@dcdwest.UUCP (03/30/84)
We have noticed a case where a csh shell script which contains a loop that runs for many hours (sometimes, days even) accumulates all the free memory on the system and causes the vax to brought to its knees due to paging activity. The RSS (resident set) of the shell expands to over a thousand pages (40-50% of the availible memory on a 4 MB memory vax). This shell script makes heavy use of variables and in-line command execution (e.g., set N = `pwd`, etc.) but none of the output of these commands which are read into shell variables are more than a hundred bytes. Since the RSS remains as high as the total size, it seems that csh is touching all the pages regularly. In a preliminary examination of the shell's memory allocation code, this type of behavior would be quite possible as the shell scans its list of memory blocks in the "alloc" routine. The bug appears to be that it never reuses memory found during the scan but continually allocates more. Has anyone else noticed and/or fixed this type of bug in 4.2 BSD csh code? If so we would apprecicate hearing about it before we start digging into csh's memory allocation code ourselves. Peter H. Berens ITT Defense Communication San Diego, CA (619) 578-3080 x240 decvax!ittvax!dcdwest!phb or ucbvax!sdcsvax!dcdwest!phb