LUA Memory Limit
Someone in my guild ran a diff of UserSettings.txt and noticed there is now a line for LUA memory limit:
Code:
SET LuaMemoryLimitMB "64" For a rough estimate, my personal SavedVars folder is running around 10.5MB and 14MB in the addons folder. Most data-heavy addons seem to either pre-define the data (map pins) or pull and store the data in SavedVars (inventory, character info, guildmate info), so adding those would be a decent estimate. EDIT: For an actual count, you can use this (or a variation): Lua Code:
|
My saved variables folder is 52.4MB (the biggest is PriceTracker.lua with 34.1MB) and no error so far.
By the way there is a new event: EVENT_LUA_LOW_MEMORY and when it occurs, it shows this error message: "Lua is reaching its memory limit. You should consider disabling some addons and reloading the UI." |
Now that is very handy news to have--I'm always worrying about memory.
Especially the event. Now I can use the event to add a function that provides players with a little more information, like "Hey, take a screenshot and post this in a bug report for DD! I want to know if you see this!" |
Quote:
Addon folder 33MB (96 addon) Savedvariables folder 24MB On main char ~85 addon active, no error On alts ~85 addon active, always get the error On mules 40-50 addon active, no error |
o.O In WoW, it's not unheard of to have memory usage of over 150MB.
|
Quote:
With Lua's garbage collection, can you free much memory usage from within an add-on? Free up a few tables by setting them to nil? Set any textures to nil or unload otherwise free them? I don't know if an add-on can disable or free itself. I guess you can un-register for events, or even set functions to nil but I don't thing that's enough to kill an add-on in memory. (Functions being a first-class data type / object) Not intended to be dismissive of Lua or the versatility of automatic GC. Just surprised to see it, but I'd guess its visible unintentionally because it is part of the Add-on API / support. |
So I'm getting this every time I log in, can I change the setting in the UserSettings file to a bigger number to make it go away? If so is there some sort of upper limit number that I shouldn't set it above? :confused:
|
Quote:
Quote:
|
Quote:
Also, how many addons are you running? This could just be because you use a lot of addons (which adds up) or could be from a couple that just use a lot of RAM. PS: To see how much RAM you're actually using, you can enter this command in the chatbox: Lua Code:
|
Just as a follow up, I checked and I'm currently using about 74 megs, so 10 or so over the default limit. I went ahead and edited that line in the UserSettings file and doubled it to 128. It stopped the message popup every time I logged in or reloaded the ui. Nothing negative noticed as of yet.
|
Quote:
|
Quote:
http://www.lua.org/pil/17.html That way the GC can decide to throw it out when it needs memory, but it stays around if no collection is neesesary. And generally the GC should have tried to collect everything possible before it runs into a OOM exception. The most reliable way to use a weak reference is to assign it's value to a local variable. If the item was already collected, you get nil. If not, you now have a strong reference (for the duration of your code). I used a weak reference table for the cache in LibConstantMapper. If the GC needs the memory, it can collect it any time. If not, it keeps the calls up to speed. |
Quote:
This lua memory limit (propably) only says how much of those 4 GiB can be taken up by Lua (and thus addons). If you set it too high, addons might take too much memory and then there is not enough for the graphics and game left (so game OOM exception might become more common). Raise it carefully and ideally by multiplying the original value by 2. |
Quote:
|
I set my LUA memory from 64 to 128 as I saw here, and I save the file, but it seems to keep setting itself back to 64. Any similar experiences/suggestions?
|
Don't forget to set the file properties to read only after you've made the changes you want.
|
Quote:
It's because game reads settings from the file only during the startup. But settings are saved from memory to the file everytime when you logout to the character selection screen, to the account login and finally when game is closed. In other words if you've made any changes to the settings when game is running, it will be automatically overwritten with the settings currently in use. If you want to change Lua memory limit value when game is running, type the following command to the chat: Code:
/script SetCVar("LuaMemoryLimitMB", "128") Quote:
|
All times are GMT -6. The time now is 09:24 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI