The proposal involves estimating the memory requirements of a program by a pre-processor at compile time. The information obtained about the memory requirements is used for designing better memory management schemes in conventional uniprocessor virtual memory systems, CVM, for efficient page distribution in a distributed virtual memory system, DVM, and for load characterization necessary for load balancing operations. The pre-processor analyzes the source code to identify the locality constructs exhibited by the program. Then it estimates the virtual sizes of the localities and the position or the level of a locality construct within a structure of nested localities. For CVM, the size and the level of a locality are passed to the operating system through memory directives. At execution time, the operating system allocates memory to the running process guided by memory directives. For DVM, the directives are used to distribute the pages of a program over distinct sets and to distribute the sets of pages over various nodes in the system. A quantitative characterization of the load through estimation of the memory requirements of a program will provide a solution to the synchronization problem encountered in load balancing. As a side effect, this will give more precise definition of balanced system.