Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local memoryTable = {}
- local function updateMemoryTable()
- local numAddons = GetNumAddOns()
- for i = 1, numAddons do
- memoryTable[i] = {i, select(2, GetAddOnInfo(i)), 0}
- end
- end
- local function sortMemory(a, b)
- if a and b then
- return a[3] > b[3]
- end
- end
- local function updateMemory()
- UpdateAddOnMemoryUsage()
- local total = 0
- for i = 1, #memoryTable do
- local value = memoryTable[i]
- value[3] = GetAddOnMemoryUsage(value[1])
- total = total + value[3]
- end
- table.sort(memoryTable, sortMemory)
- return total
- end
- updateMemoryTable();
- print(updateMemory());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement