1. A method for handling objects in a computer system having a multi-level memory hierarchy with two or more levels of memory, each level being one of two or more types of memory, the method comprising: by a system runtime: identifying an object to be stored in the multi-level memory hierarchy; determining, based on one or more attributes of the object, that the object is to be pinned in a level of the multi-level memory hierarchy; and pinning the object in the level of the multi-level memory hierarchy.