Added forced garbage collection to prevent crash when exporting from Postgres.