ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Lua Memory Usage on function calls (https://www.esoui.com/forums/showthread.php?t=2177)

Dero 08/24/14 11:41 AM

Lua Memory Usage on function calls
 
1 Attachment(s)
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: Attachment 444

merlight 08/24/14 11:59 AM

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

katkat42 08/24/14 12:11 PM

Quote:

Originally Posted by merlight (Post 11819)
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. :D

Minceraft 08/26/14 04:50 AM

This was great!!!!
 
Quote:

Originally Posted by katkat42 (Post 11821)
I'd also be tempted to link to this funny story. :D

Hehe, thanks for that!! I have now bookmarked that site!!


All times are GMT -6. The time now is 06:58 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI