private ArrayList<HashMap<String, String>> sortArrayMap(ArrayList arrList)
{
ArrayList retArray = new ArrayList();
Hashtable tableUnOrdered = new Hashtable();
for (int i = 0; i < arrList.size(); i++)
{
HashMap<String, String> map = (HashMap<String, String>) arrList.get(i);
tableUnOrdered.put(map.get("TCNT"), i);
}
Vector v = new Vector(tableUnOrdered.keySet());
Collections.sort(v);
for (int j = 0; j < MAX_ITEMS_PER_GRAPH && j < v.size(); j++)
retArray.add(v.get(j)); // add the list in the needed order
return retArray;
}
我无法找出这段代码中发生内存泄漏的地方,有人能告诉我吗。我的老板说这个代码有内存泄漏,并要求我找出答案。