Thread Tools Display Modes
08/24/14, 11:41 AM   #1
Dero
 
Dero's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 14
Lua Memory Usage on function calls

Hey Guys,

i made a little Addon to analyze the Memory usage of Lua.
While playing around a little bit with it, i noticed, that every function call consumes a bit of Memory wich isnt get freed after function ended. e.g.
Lua Code:
  1. ESO_MU.Collect()
Am i doing something wrong, or is it just Lua, wich isn't collecting the garbage in a proper time?

functions:
/mu start [time in ms] -- starts the memory display (default 500 ms)
/mu stop -- hides the memory display and stops at next interval
/mu collect -- collects the garbage and displays the freed memory in Chat

Here is the Memory Usage Addon if someone wants to check: MemoryUsage.zip
  Reply With Quote
08/24/14, 11:59 AM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
As long as garbage is collected at some point, it's ok. Immediate collection is IMO only possible with reference-counting (such as in Python); which Lua doesn't use because it poses much bigger problems than delayed collection http://lua-users.org/wiki/GarbageCollectionTutorial
  Reply With Quote
08/24/14, 12:11 PM   #3
katkat42
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 155
Originally Posted by merlight View Post
Immediate collection is IMO only possible with reference-counting (such as in Python); which Lua doesn't use because it poses much bigger problems than delayed collection
I'd also be tempted to link to this funny story.
  Reply With Quote
08/26/14, 04:50 AM   #4
Minceraft
 
Minceraft's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 51
Thumbs up This was great!!!!

Originally Posted by katkat42 View Post
I'd also be tempted to link to this funny story.
Hehe, thanks for that!! I have now bookmarked that site!!
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Lua Memory Usage on function calls


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off