Fix JIRA-979 to balance in-memory partition distribution

As JIRA-979 (https://spark-project.atlassian.net/browse/SPARK-979) described, executor resources we supplied for each stage(taskset) is just sorted by the sequence of registration. so in some scenarios with caching in-memory partition, it leads to less memory in the top of executors while enough memory in others. Now I have implemented LRU algorithm to improve distribution of in-memory partition.
BTW, Is there any suggestion for doing CPU cores+memory size scheduler in Spark? I think it is hard to know memory size that will be cached by one task in advance