Fixed reading the events heap size without locking it.