improve getFree*ActiveObjectId to reduce common case cpu usage