• 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.

Fixing memory leaks.

Status
Not open for further replies.
Level 9
Joined
Sep 8, 2004
Messages
633
Hello fellow mappers, again it has been quite a while since i last posted, yet again i'm in need of assistance.

Recently, someone reminded me of memory leaks in warcraft 3 maps, so i hauled all of my triggers (474) through a leak checker, it came to light that i have over 1000 memory leaks in my map. It concerns the following types;
- Unit group leak, when a trigger picks every unit in (units xxxxxx), the group remains after the trigger is done, it is not removed by default.
- Position leak, when something is pointed to the center of a location, the point "center of location" remains as a point, it is also not removed.

These leaks are a result of faulty code, since i used only GUI triggering, i didn't think i could make leaking code, but it seemed that blizzard didn't do this part well either, resulting in me finding out that i've got over 1k leaks in my map which will take weeks to fix.

Now, to the point; Is there a way of fixing the leaks without having to go over every damn trigger myself? Is there some kind of tool or plugin (For WE) that can help me? I'd hate to do that much of repetetative work. (Some of my triggers contain over 100 leaks!) Please help.

- Angelusz
 
Level 6
Joined
Feb 18, 2005
Messages
263
i thought about it...

the only way i found ( i haven't searched for a tool of plugin ) is that you might save your map and then open it with a mpq-tool
then you open the jass file and go through that...

for editing text-files there shall be plenty of codes/tools/plugins that can do repetive work.

i hope this helps!

- Raszul
 
Level 9
Joined
Sep 8, 2004
Messages
633
I know how to fix them. The point is that i would have to do it over 1k times, which i really don't feel too much like doing. I'm wondering if there's an easier way.

I'll try the JASS-solution, but it'd be best if i could get my hands on some tool that could run through the entire mpq and patch it up, some kind of optimising tool. (Too bad vexorian's doesn't fix these..)
 
Level 9
Joined
Sep 8, 2004
Messages
633
Aye, i would have cleaned them up from the beginning, if only i found out earlier, which i didn't, only recently. It didn't even come to my mind that i could have memory leaks since i used GUI triggering, i thought blizzard would have all such things covered and that memory leaks would be caused by faulty self-made JASS. I was wrong.

Now, i guess i'm stuck with fixing all those leaks.
 
Level 9
Joined
Sep 8, 2004
Messages
633
PurplePoot said:
its a good thing you have to manually clean up leaks.

if you didnt, things would happen, like say...

Destroying a Group that you were halfway thru using

Removing a location you wanted to use 5 seconds later

etc...

I disagree, since i didn't imput those locations manually i won't need them after that one function. Every fix can be the same here.

Anyone?
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
what about this

Events
Unit - A Unit Starts the Effect of an Ability
Conditions
Ability Being Cast Equal to 1 Second then Wham!
Actions
Wait 1 second
Order Triggering Unit to damage cricular area around Target Point Of Ability Being Cast for 10 damage over 0 seconds

--------------------------------------------------
under your theory, there would be no more Target Point Of Ability Being Cast after that 1 second.
 
Level 9
Joined
Sep 8, 2004
Messages
633
PurplePoot said:
So you're saying 2 things

1) Waits would suck ( in ur 'perfect gui' )

2) Screw ppl who use them

and also

what if it removed them INSTANTLY?

see the problem???

What the hell are you talking about now? I'm not saying either of these things. I will ignore your posts from now on, i really don't need people like you to try and help me since obviously it's not working.
 
Level 4
Joined
May 6, 2006
Messages
79
purplepoot seems to have way more experience than you angelusz, since he tries to find solutions for EVERY situation, not only for your map where everything is INSTANT.

Stop that "What are you talking about?" thing, it's annoying!! ...

By the way I know how to fix your leaks... shove them up your ass!!

Oh and that's not all I wanted to say... I'm an ignorant to these memory leaks problem, so PurplePoot... i would suggest you to write a Memory Leaks Tutorial, for people like me. It would be very helpful

Once again Angelusz try to find sense in what PurplePoot said... i don't know how this memory leaks can be stopped, but i did understood what he meant

Oh and that trigger was also easy to "decipher"...
 
Level 4
Joined
May 6, 2006
Messages
79
haha guess you noticed that I posted before looking for a tut ... XD

well i'll take a look at blake's then

thnx!
 
Level 9
Joined
Sep 8, 2004
Messages
633
Rodsazo, i have nothing to say to you.

The point of this thread was to find out if anyone has a better way of fixing memory leaks beside going over all triggers and manually insert custom scripts and using variables to set temporary locations etc.

It would seem that there's no such thing and i'm bound to go over all of them myself. (hooray... :cry: )

For your interest, I already know how to fix leaks, just wanted to try and find an easier way!

(Edit:)
Oh, I forgot to add, I consider this thread closed.
 
Status
Not open for further replies.
Top