When fielddata eviction occur?

I saw that metric
fielddata_evictions
When fielddata eviction occur?

It occurs when an index is closed, or after a merge when all segments that contributed to the merge are removed.