Below query helps in identifying what type of objects are taking up most of the plan cache.
SELECT objtype AS ‘Cached Object Type’, count(*) AS ‘Number of Plans’,
sum(cast(size_in_bytes AS BIGINT))/1024/1024 AS ‘Plan Cache Size (MB)’,
avg(usecounts) AS ‘Avg Use Count’ FROM sys.dm_exec_cached_plans
GROUP BY objtype
If adhoc queries take up most of the plan cache, it indicates that queries should be parameterized and enclosed within stored procedures for efficient use of plan cache.