Avoid Memories leak

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
JJ2197
Legendary Genius
Posts: 1311
Joined: August 8th, 2007, 8:10 am
Title: Legendary Genius²
Location: St. George Utah

Re: Avoid Memories leak

Post by JJ2197 »

I haven't ever really had much lag from it... really only when over using the copy command
But of course that has nothing to do with leaks... heh...
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

JJ2197 wrote:I haven't ever really had much lag from it... really only when over using the copy command
But of course that has nothing to do with leaks... heh...
It could easily be leaking if uses GetUnitLoc or something similar.
User avatar
JJ2197
Legendary Genius
Posts: 1311
Joined: August 8th, 2007, 8:10 am
Title: Legendary Genius²
Location: St. George Utah

Re: Avoid Memories leak

Post by JJ2197 »

Well I don't know JASS very well, but I think it wouldn't leak due to it destroys the referance
point of the unit with GroupRemoveUnit... though I could easily be wrong... =/
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Avoid Memories leak

Post by weirdone2 »

You also need to call removelocation on the reference before you null the ref or your stuck with that loc being ter 4eva. :P
User avatar
JJ2197
Legendary Genius
Posts: 1311
Joined: August 8th, 2007, 8:10 am
Title: Legendary Genius²
Location: St. George Utah

Re: Avoid Memories leak

Post by JJ2197 »

So just add like call RemoveLocation(GetUnitLoc(u2u)) right after the endloop...?
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Avoid Memories leak

Post by weirdone2 »

no heres a sample of my cheapack whenever i feel like updating it that is mayb ill do it tonite, neway.

Code: Select all

function xWY takes nothing returns nothing
local location j=GetUnitLoc(GetTriggerUnit())
call CreateUnitAtLoc(GetTriggerPlayer(),GetTrainedUnitType(),j,270)
call RemoveLocation(j)
set j=null
endfunction
User avatar
JJ2197
Legendary Genius
Posts: 1311
Joined: August 8th, 2007, 8:10 am
Title: Legendary Genius²
Location: St. George Utah

Re: Avoid Memories leak

Post by JJ2197 »

Well anyways, I don't seem to notice lag unless I look at the mass of units...
So I guess even if this does leak, it must not be much :?
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Avoid Memories leak

Post by weirdone2 »

Nope it leaks one location every time a unit is copied, so only if you create many many units with copy will this even start to be noticed.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

JJ2197 wrote:So just add like call RemoveLocation(GetUnitLoc(u2u)) right after the endloop...?
Any native that returns a location actually creates a location (Instead of providing reference to one)
Therefore, "GetUnitLoc(u2u)" creates a location when it's called (So RemoveLocation(GetUnitLoc(u2u)) is just removing a location it just created...accomplishing nothing).
You can prove this by running a test similar to this:

function test takes nothing returns nothing
local unit u=GetTriggerUnit()
local location a=GetUnitLoc(u)
local location b=GetUnitLoc(u)
call RemoveLocation(a)
call CreateUnitAtLoc(Player(0),'hpea',b,0.)
call RemoveLocation(b)
set a=null
set b=null
endfunction
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Avoid Memories leak

Post by initialD »

weirdone2 wrote:
Weirdone, i really didn't use your codes. Netheir do I used JJ codes.
I hoped I could use them but those codes leak. So I used Aero's suggestion. And add somemore thing I needed.
Your -tele or Jj's -tele was using call location xy right? Since I don't wanna to use the removeLocation thingie I have to do it another way.
Pfft You're still using the concept. :P I don't really care much if you use my code as long as you don't try to pawn it off as your own idea/code. It's just something I mentioned since I saw you post it. :) Also as a note I don't know about jj's as I've never used it but my pack doesn't lag unless you do something dumb in it.
I said "I didn't use your codes" That's it. Btw, that's Aero's codes, and your idea. Please don't mix them up ok?
I give credits for using codes, not ideas. Since I can't really know where the source of all ideas.
Btw, this idea was already on Sg-Guys pack. By using the already existed command, changing it so something else. (it uses STOP), and the wtf blink idea was already on Xantan's pack for a long time.
So let's say thank you to all of you. Thanks Xantan, Sg guy and your idea.
I was a fan of Xantan's and Sg-Guys' pack since i play a lot of dota. You are right it's your idea.
But not codes. Codes belongs to Aero. I believe I have the right to call the command made by me, because that command(in the latest fai's pack) ,has only used a native function suggested by Aero. Inside it there is a player code detector, a string location detector, a string dectector for a the disbale command, and another string command for "-closing all functions".

For all those who didn't know anythng about JASS, you could just test it by using the tp. on dota made by me. It can be teleported into fog of war.
I haven't even once play Weirdone's pack, since it uses a diferent native, I can see that it will not able to blink into the fog of war. It's just 2 different blinks.
Aero wrote:
initiald wrote:p/s the server split was caused by some invalid return. I just knew this "Blizzard bug" recently.
Whenever a function takes something from boolean, if the boolean is "invalid", BLizzard would not return automatically itself, the command will stay there for as long time as possible, till all player dc'ed. Since JASS is still not official codes for Blizzard, these kind of bug will not be fixed in the future patch.
w/e
No idea what you mean.
hmmm, it's just as simple

Function Anything takes nothing return boolean
if abc==cde then
return true
endif
endfunction

thiese kind of function is causing the server split, or everyone dc'ed.
it could be fixed by just adding one more line.

Function Anything takes nothing return boolean
if abc==cde then
return true
endif
retunr false
endfunction

So it would have something to return in w/e situation. I saw some of this invalid returns on other packs as well. If the particular command was spammed too much, it will cause players dropping one by one, or worse, all dc'ed.
The only bad thing is JASScraft never tells you if you have made this kind of misakes. So the way I tested it was to put CallDisplayText on the end of all cheat commands, so I can test which command doens't return.
Last edited by initialD on April 30th, 2008, 4:20 am, edited 1 time in total.