| 10-25-2004, 04:45 AM | #1 |
I've been working a long time on a map, it's maybe 3/4 done. However, when I play it, it gradually becomes unplayable which I assume must be a memory leak. Here are the things I have already done to try to stop leaks: - Ensure special effects are stored in variables and destroyed after use - Ensure points and unit groups are stored in variables and destroyed/removed in recurring triggers (got that from a tutorial here) - Destroy triggers after they execute (with a few exceptions) - Remove most dynamically created units from the game when they die. I'm out of ideas, what have I missed? I'm getting fairly desperate... the map is going to be a multiplayer RPG (with one player "evil"), and I think it will be great. However, it's unplayable after 30-40 minutes. I've watched the memory gradually climb, and the game slows to a crawl. :( If nobody has other ideas for me to try, I still need help. If there is a willing expert out there, I'd love it if you could take a look at the map. In that event, I can provide some info useful in understand the triggers in use, etc. Thanks, all. A couple of additional things I'll mention: 1) I've altered the game camera and locked it to the player's hero. View/pan is moved via arrow-keys. There is not a rapidly firing trigger updating the camera (as I've seen in some altered-camera maps) 2) I have several "Unit dies" triggers, that remove creeps when they die. There was lag both before and after this trigger -- but nevertheless it probably gets called many many times (every time a creep dies). Is that bad? |
| 10-25-2004, 05:03 AM | #2 |
Mines the same but mine is when its loading and once its 5/8 done it crashes...stupid we...soemone help us! |
| 10-25-2004, 01:15 PM | #3 |
oooook... i think you do have a memory leak. do any of your units leave trails of any sort that should be removed? or are there spawn triggers that can go haywire sometimes? it could really be almost anything. If youve edited constants, take a look at them... i cant really help without the map and im only DECENT at trigers.... Gandalf 24 is pretty fluent in triges and should be able to help you out.... (BTW, this should be in the trigers section Mods) -Garith |
| 10-25-2004, 02:36 PM | #4 |
Nope, no trails. I do have edited constants, though. What should I look for there? |
| 10-25-2004, 06:09 PM | #5 |
Keep in mind that polar projections will leak two point variables. You have to clean both up, or use a JASS polar projection function. I don't know too much about this myself, but it may be an issue. Also, note that you should'nt jsut remove a unit. The most idiot-proof method of removing units from a map is to explode them in a small corner then remove them. |
| 10-25-2004, 06:16 PM | #6 |
Exposing my ignorance here -- polar projections? What is that? Perhaps I am doing it without realizing that's what its called. I change the angle of the camera, etc, in response to keyboard events. That leaks points? Also, in regard to removing units, the units in these maps are spawned, move to attack, and get killed in battle. It is after that that I remove them (via the 'Unit dies' trigger I mentioned originally). Since they are already dead, do/can I still move them as you mentioned? There are a few temp units I treat as you mentioned. |
| 10-25-2004, 06:20 PM | #7 |
Ummm the "point with polar offset" function. That's a polar projection. |
| 10-25-2004, 06:28 PM | #8 |
Thanks, I will take a look at my camera triggers and check on that. Can't at the moment, at work ;) Could the rmove unit triggers be causing a leak (because the execute so many times?) |
| 10-25-2004, 09:57 PM | #9 |
hmm, im experiencing this same problem. is it a good idea to remove units after they die? like if theres a lot of them being spawned. also, how do you check how much memory a program is actively using? I think someone should make an "All the Causes of Lag" thread. |
| 10-25-2004, 09:59 PM | #10 |
I was just alt-tabbing out on XP and watching the performance tab. The memory was climbing. As for the causes of lag -- I 've seen some tutorials here, but I've tried everything in them. Aieeeee. I'm going to go home tonight and check on the polar point leak possibility. If that doesn't help, it will be time for despair! Cold, cruel, bitter DESPAIR!!! |
| 10-26-2004, 01:13 AM | #11 |
So I'm not doing anything with polar projections, including in the camera triggers. I'm using integers and reals, which are stored in variables, and adjusting the camera angles based on those variables. No polar anything mentioned. It seems it's time for that previously mentioned desperation! Is there anyone who could take a look at this map for the elusive leak(s)? Sometimes all it takes is a second pair of eyes. :\ On second thought, here is the trigger in question -- is it free of suspicion? ======= EVENT: Player - Player 1 (Red) Presses the Left Arrow key ACTION: Set camerAngles[(Player number of Player 1 (Red))] = (camerAngles[(Player number of Player 1 (Red))] + 30.00) Set player1angleCheck = camerAngles[(Player number of Player 1 (Red))] Camera - Set Player 1 (Red)'s camera Rotation to camerAngles[(Player number of Player 1 (Red))] over 0.20 seconds ======= There is one of those for each arrow, and each player. If that's "clean" i'm still out of ideas. I still want to know -- is my cleanup trigger causing memory leak (the "unit dies" trigger that removes after they die)? |
| 10-26-2004, 02:21 AM | #12 |
I dunno, after looking at my map all of my rapid firing triggers and commonly happening triggers, well i completely cleared them from leaks. but i can go through the map without running any of the low occuring triggers and it will still start to lag. I think lots of units might do it :\. also i noticed that (sort of obviously) when i look at doodad/unit heavy areas it lags more. |
| 10-26-2004, 03:03 AM | #13 |
So, even after turning off all your triggers, you still had a memory leak? Was it lag or a leak? By the way, I disabled my unit-rmoving "unit dies" triggers and I still leaked. I wish there was some way I could salvage this map. I've put so much work into it. |
| 10-26-2004, 03:16 AM | #14 |
no, i didnt turn them off i just never did the actions that make them happen. like i just sit there and dont cast any trigger spells. |
| 10-26-2004, 04:22 AM | #15 |
And you still leaked? Did you say your triggers were off, or that you just checked them? Mine are still on, and I've checked them. Maybe I'll try playing with them off. If I still leak after that... it must be something else. This is so depressing. Maybe you and I should trade maps Twister? |
