On what basis DB2 evicts the plans from package cache ?
Biswarup(Bis)Mukherjee 120000HKTY Visits (8221)
The actual cleanup logic looks at a bunch of things in order, for example, invalid entries, empty entries that got left behind, and eventually evict entries based on least recently used order. The package cache daemon would try to do cleanup if the package cache is at least 90% full. Fixing the package cache size does not affect how the package cache daemon behaves (e.g. how it chooses when and what to cleanup). When PCKCACHESZ is set to AUTOMATIC to be tuned by STMM, there's logic that looks at how many times the package cache has been overflowed and other stats to determine if more memory needs to be allocated to the package cache from other memory pools.
As a general rule, as new statements get executed, the package cache will get filled up and old entries will age and get evicted as there's only limited amount of space.