| 08-24-2006, 03:23 AM | #1 |
I just finished going through my map and nullifying a bunch of locals that needed to be. They were basically 3 year old triggers. I didn't know about setting to null back then. For some reason now, the map has a long pause after exiting back to the channel on bnet. I didn't create any new triggers, just cleaned up old ones. Any ideas of the cause? |
| 08-24-2006, 05:30 AM | #2 |
Memory leaks. |
| 08-24-2006, 05:36 AM | #3 |
That's what I figured, but I didn't add anything. Just nullified a bunch of locals. Thanks, I'll see what else I may have done to cause it. |
| 08-24-2006, 12:54 PM | #4 |
Only logical explanation would be nullifying the locals before destroying the objects pointed by them |
| 08-24-2006, 01:07 PM | #5 | |
Quote:
Hehe... Im confused Vex.. U mean we use RemoveUnitGroup etc before we nullify them or u were sayin before u destroy (as in destroy special effect etc) Sorry to go off topic.. got the same problem wid nullifiying.. |
| 08-24-2006, 01:32 PM | #6 |
he mean like JASS:set l = null call RemoveLocation(l) |
| 08-24-2006, 03:05 PM | #7 |
setting vars to null is supposed to prevent memory leaks, not to cause them so if they cause them the only logical explanation is that you are doing something like what Thunder_Eye said, if not, then it should be something really weird or you did something else than setting things to null |
| 08-25-2006, 12:26 AM | #8 |
I'm not nullifying them until the very end of the function. They are destroyed first. Not sure what is happening, but thanks anyway. I'll keep looking. |
| 08-25-2006, 05:35 AM | #9 |
You may be able to use JASS to help you trace leaks. Create a helper function for the allocators that you suspect to be responsible for the leak. For example, for locations, you might do something like: JASS:function locoverflow takes nothing returns nothing local integer i = 0 local integer j local integer array trigs local integer array callcount local integer temp loop exitwhen i >= 1024 //just look at the first few. set j = 0 loop if trigs[j] == 0 then set trigs[j] = udg_loctrigs[i] endif exitwhen trigs[j] == udg_loctrigs[i] set j = j + 1 endloop set callcount[j] = callcount[j] + 1 set i = i + 1 endloop call TriggerSleepAction(0.) set i = 0 loop exitwhen i>= 10 //Just look at 10 most leaky triggers set j = i loop if callcount[j] > callcount[i] then set temp = callcount[j] set callcount[j] = callcount[i] set callcount[i] = temp set temp = trigs[j] set trigs[j] = trigs[i] set trigs[i] = temp endif set j = j + 1 endloop set i = i + 1 endloop call TriggerSleepAction(0.) loop exitwhen i>= 10 call BJDebugMsg(GetStoredString(GC(),"triggernametable",I2S(trigs[i]))+" "+I2S(callcount[i])) set i = i + 1 endloop endfunction //Stick this in front of location producing calls function RegisterLocation takes location oLoc returns location local integer iLoc = HtoI(oLoc) local integer i = 0 loop if i>= 8191 then call ExecuteFunc("locoverflow") endif exitwhen udg_loctrigs[i] == 0 set i = i + 1 endloop set udg_locs[i] = oLoc set udg_loctrigs[i] = HtoI(GetTriggeringTrigger()) //Maybe a version for timersis needed too endfunction //Stick this in front of RemoveLocation function UnregisterLocation takes location oLoc returns location local integer i = 0 loop exitwhen oLoc == udg_locs[i] set i = i + 1 endloop set udg_locs[i] = null set udg_loctrigs[i] = 0 endfunction |
| 08-26-2006, 09:24 PM | #10 |
This may seem a bit obvious, but maybe your computer just needs a reboot? After my computers been on for a long time it takes longer when i hit enter on the score screen to get back to bnet |
