• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Does chaos ability cause perma unit mem leak?

Status
Not open for further replies.
I know that when a unit is created, even when it is removed it will have permanent memory in wc3 that is not cleared out until wc3 is restarted. I was wondering if applying chaos caused the same memory increase as

1. Create unit of type x
2. Remove created unit
3. Create unit of type y

I don't really want to run a memory test, so if anyone knows the answer to this or could run an infinite timed loop for like 10 hours and watch the memory, that'd be helpful : D.
 
Last edited:
Level 40
Joined
Dec 14, 2005
Messages
10,532
Don't do this. It creates massive lag and still leaks.

Compare this to the version where you just replace the whole

JASS:
            if GetUnitTypeId(u) == 'hfoo' then
                call UnitAddAbility(u,'S000')
            else
                call UnitAddAbility(u,'S001')
            endif

with

JASS:
call RemoveUnit(CreateUnit(Player(0),'hfoo',0.,0.,0.))
 

Attachments

  • Foobar.w3x
    16.4 KB · Views: 55
Chaos abilty does not cause lag :D if you like to transform , use the transform abilty as bear form , because chaos cause damage bugs when you add its again .

We're talking about viable solutions to Unit Replacement that are leakless = ). This would allow unit recycling systems to reduce crashing on large spawning maps and it'd also allow unit transformations =). I'd eventually create an lua script that'll parse over all of the unit objects in the Object Editor. From here, each level of a specific ability would be attributed to a specific unit. For example, if I were to use Chaos, Chaos lvl 0 would always be root unit, lvl 1 might be peasant, 2 might be footmen, 3 might be ghoul, and etc.

I don't see what's so important about keeping ids in most situations.

Because it's important any time you want to store the unit???
unit u = CreateUnit(...)
unit u2 = u

--replace
RemoveUnit(u)
u = CreateUnit(u)

uh oh.. u2 no longer points to the unit o_O. If we were to use Chaos for replacement, both u and u2 would still point to the unit.
 
Status
Not open for further replies.
Top