def prepare_desired_resource_dicts(point_in_time_usage):
    """Given a point in time usage, returns a list of dicts with keys columns `mem` and `user` which is the 
    sum of the waiting and running memory for each user
       
       Parameters:
       -----------
       point_in_time_usage: pandas.DataFrame
           A dataframe with keys: [time_ms, user, mem, count, mem_running, count_running]
           
        Returns:
        --------
        desired_resources: list of dicts
            A list of dicts with keys: [user, mem] which provides the user's desired resources
            sorted by mem"""
    user_desired = point_in_time_usage.copy()
    user_desired.mem += user_desired.mem_running
    user_desired = user_desired[["mem", "user"]]
    user_desired.dropna()
    user_desired = user_desired[(user_desired.mem>0)]
    resource_records = user_desired.sort_values("mem").to_records()
    desired_resources = [{"mem" : mem, "user" : user} for _,mem,user in resource_records]
    return desired_resources