*** src/backend/storage/ipc/ipc.c.orig Wed Jul 25 15:58:56 2007 --- src/backend/storage/ipc/ipc.c Sat Nov 3 23:00:41 2007 *************** *** 126,131 **** --- 126,136 ---- * $PGDATA/gprof/8845/gmon.out * ... * + * To avoid undesirable disk space bloat, autovacuum workers are + * discriminated against: all their gmon.out files go into the same + * subdirectory. Without this, an installation that is "just sitting + * there" nonetheless eats megabytes of disk space every few seconds. + * * Note that we do this here instead of in an on_proc_exit() * callback because we want to ensure that this code executes * last - we don't want to interfere with any other on_proc_exit() *************** *** 133,139 **** */ char gprofDirName[32]; ! snprintf(gprofDirName, 32, "gprof/%d", (int) getpid()); mkdir("gprof", 0777); mkdir(gprofDirName, 0777); --- 138,147 ---- */ char gprofDirName[32]; ! if (IsAutoVacuumWorkerProcess()) ! snprintf(gprofDirName, 32, "gprof/avworker"); ! else ! snprintf(gprofDirName, 32, "gprof/%d", (int) getpid()); mkdir("gprof", 0777); mkdir(gprofDirName, 0777);