WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Carbonite Archive (https://www.wowinterface.com/forums/forumdisplay.php?f=158)
-   -   Error reported in Carbonite.Quests module & possible memeory leak (https://www.wowinterface.com/forums/showthread.php?t=45880)

Crablouse 02-24-13 09:40 AM

Error reported in Carbonite.Quests module & possible memeory leak
 
Hi!

I get massive errors from the carbonite.quests module:

62x Carbonite.Quests-1.0\NxQuest.lua:10212: attempt to index field "?" (a boolean value)
Carbonite.Quests-1.0\NxQuest.lua:10212: in function "DecodeComRcv"
Carbonite.Quests-1.0\NxQuest.lua:1724: in function <Carbonite.Quests\NxQuest.lua:1722>
<string>:"safecall Dispatcher[4]":4: in function <string>:"safecall Dispatcher[4]":4
<in C code>
<string>:"safecall Dispatcher[4]":13: in function "?"
Ace3-r1079\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:92: in function "Fire"
Ace3-r1079\AceComm-3.0\AceComm-3.0-7.lua:339: in function <Ace3\AceComm-3.0\AceComm-3.0.lua:321>

Locals:
nil

Also I detected that the memory usage of carbonite is increasing very fast (about 45-90 Kbytes / secs). After 5 mins it reaches 20 MBytes. The memory is freed sometimes by the garbage collector so I don't worry about that at the moment.

Geetings.

JimJoBlue 02-24-13 09:46 AM

This is posted in the wrong section...
You are using the BETA and should have been posted here:- http://www.wowinterface.com/forums/f...play.php?f=160

I can tell by the Carbonite.Quests in the report..

Crablouse 02-24-13 10:44 AM

Sorry me fault. I will post it in the beta forum.

So someone can close this thread here.

Rythal 02-24-13 11:08 AM

I'll move it... you can also find the temporary fix until I release next version in that forum aswell.

Rythal 02-24-13 11:15 AM

as for memory leak ... i've been trying to narrow down what or where is causing the increase every second happening... but yeah it hasn't been a top priority since as you also noticed garbage does free it.

It might not even be a memory leak but the new comms routines, since to talk to the modules I have to send whispers to yourself over the addon channel... this fires every second, so i'm using AceComm's queue's to ensure it's not considered spam by blizzard and kicks you off the server.

Crablouse 02-24-13 11:47 AM

Thank you Rythal,

the quick fix solved the problem for me.

Regards.

Rythal 02-24-13 02:37 PM

update on the memory leak... it's being caused by my attempts to keep memory down, like carbonite of old I was trying to keep colours as a single variable instead of 4.. so like,

WatchList = "red|green|blue"alpha"

but in bringing them back, i'm using strsplit (well actually started with my own custom written explode .. didn't know blizzard had added strsplit) which is causing the memory jumps until garbage collection. Trying to find a better way to do things now instead of calling strsplit constantly.

dhjohn 02-24-13 07:25 PM

Quote:

Originally Posted by Rythal (Post 273415)
update on the memory leak... it's being caused by my attempts to keep memory down, like carbonite of old I was trying to keep colours as a single variable instead of 4.. so like,

WatchList = "red|green|blue"alpha"

but in bringing them back, i'm using strsplit (well actually started with my own custom written explode .. didn't know blizzard had added strsplit) which is causing the memory jumps until garbage collection. Trying to find a better way to do things now instead of calling strsplit constantly.

I'm not sure on lua, but my gut tells me you won't save much space by compacting multiple strings into one. Since a string has to hold each character as a byte, you can't gain space by putting strings together unlike with integers which can hold four bytes in one. (well, you can save the slight overhead of multiple objects, but I can't imagine it is worth the time splitting and joining the strings).

Rythal 02-24-13 08:55 PM

Quote:

Originally Posted by dhjohn (Post 273425)
I'm not sure on lua, but my gut tells me you won't save much space by compacting multiple strings into one. Since a string has to hold each character as a byte, you can't gain space by putting strings together unlike with integers which can hold four bytes in one. (well, you can save the slight overhead of multiple objects, but I can't imagine it is worth the time splitting and joining the strings).

which is exactly it... since colors use integers, so by combining i'm using 1 string instead of 4 integers.

the leak is happening in 2 scripts, NxSocial and NxQuest ... i've got it fixed in NxSocial now by just having a array of the colours unpacked, instead of unpacking them every update... will look into NxQuest next and see if that fix works there too.


All times are GMT -6. The time now is 11:28 PM.

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