Network applications often define policies to manage network traffic based on its attributes (e.g., a service chain, valid next-hops, permission flags). These policies match against packets' attributes in switches before being applied. However, the prior works of identifying attributes all incur a high memory cost in the data plane. This paper presents MEME, a scheme that clusters the attributes in packets to reduce the memory usage. MEME also leverages match-action tables and reconfigurable parsers on modern hardware switches to achieve 87.7% lower memory usage, and applies a graph algorithm to achieve 1-2 orders of magnitude faster compilation time than the prior state of the art . These performance gains pave the way for deployment of a real system desired by the world's largest Internet Exchange Points.