_G.__uids are not updated correctly

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Graziel
Wyrmic
Posts: 234
Joined: Wed Sep 15, 2010 10:32 am

_G.__uids are not updated correctly

#1 Post by Graziel »

in lua console after typing

Code: Select all

=_G.__uids
you get bunch of uids created in game but they are never deleted from there, after leaving zone each entity has given new uid and its added to _G.__uids I.E. :

- enter zone "green worm mass" has uid of 156
- type into console =_G.__uids[156] - we get data of "green worm mass"
- leave zone
- enter zone now green worm mass has uid of 1076
- type into console =_G.__uids[1076] - we get data of "green worm mass"
- type into console =_G.__uids[156] - we get data of SAME "green worm mass" !

you can go out and enter multiple times each time _G.__uids will grow and reference count will increase ( so next time "green worm mass" will be in 3 places, next in 4 etc, since its about ALL entities (particles, projectiles, items etc.) _G.__uids grow VERY fast)
You are likely to be eaten by a grue

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: _G.__uids are not updated correctly

#2 Post by darkgod »

Hum, are you sure they are never removed? I did some test and the garbagecollector does delete them after a while
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Graziel
Wyrmic
Posts: 234
Joined: Wed Sep 15, 2010 10:32 am

Re: _G.__uids are not updated correctly

#3 Post by Graziel »

just did 25 min testing and yes they didnt got deleted, probably because i didnt 'kill' it and its still in multiple places there

you probably kill it and normal gc cleaned entries there, but as long as it 'lives' it will stay there in multiple places.
You are likely to be eaten by a grue

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: _G.__uids are not updated correctly

#4 Post by darkgod »

Hum, what do you do exactly ? uids from zones you left should disappear; is that what you are doing ?
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Vagabond
Uruivellas
Posts: 759
Joined: Mon Jan 06, 2003 7:09 pm
Location: London, UK

Re: _G.__uids are not updated correctly

#5 Post by Vagabond »

I'm not an expert of Lua, but garbage collecting languages often leave references in place if there is no shortage in memory (so that the performance hit of garbage collection won't effect the system, only when it is really important). Also, this is often platform dependent as well, so it might work differently on - say - windows and linux.
Bond

Post Reply