call gc before logging