How are the VLANs selected from the pool


We have defined a pool of VLANs in the oned.conf file. If we have 1000 vlans in that pool then in the document it states that it selects the free vlan from the pool.

How does it check for the assigned vlans and decide the next free vlan to select. Is there a process for it?