The number of MAC addresses that a switch may need to store in comparison to the number of routes it needs to hold depends on where it is deployed in the network.
The memory used for TCAM tables is limited and allocated during the boot-up process on the switch. When a section of hardware resources becomes full the packet processing is sent to the CPU which can seriously impact the performance of the switch.
The ratios of allocation between Layer 2 and Layer 3 features are stored and modified using Switching Database Manager (SDM) templates. The SDM template can be changed on Cisco 9000 series switches with the command
sdm prefer vlan or
sdm prefer advanced in global configuration mode. If the switches are stacked then every switch is required to be configured with the same SDM template.
The current template can be viewed with the command
show sdm prefer