Long-term information associated with neuronal memory resides in dendritic spines. However, spines can have a limited size due to metabolic and neuroanatomical constraints, which should effectively limit the amount of encoded information in excitatory synapses. This study investigates how much information can be stored in the sizes of dendritic spines, and whether is it optimal in any sense? It is shown here, using empirical data for several mammalian brains across different regions and physiological conditions, that dendritic spines nearly maximize entropy contained in their volumes and surface areas for a given mean size. This result is essentially independent of the type of a fitting distribution to size data, as both short- and heavy-tailed distributions yield similar nearly 100 % information efficiency in the majority of cases, although heavy-tailed distributions slightly better fit the data. On average, the highest information is contained in spine volume, and the lowest in spine length or spine head diameter. Depending on a species and brain region, a typical spine can encode between 6.1 and 10.8 bits of information in its volume, and 3.1-8.1 bits in its surface area. Our results suggest a universality of entropy maximization in spine volumes and areas, which can be a new principle of memory storing in synapses.