1. A method for automatically reordering variables, the method comprising: as a part of compilation, identifying a set of variables that are candidates for reordering, wherein the candidate variables are associated with one or more source code files that are being compiled; collecting data for determining a potential layout for the candidate variables; as a part of linking, determining the potential layout based, at least in part, on the data; and reordering the variables based, at least in part, on the potential layout.