Results 1 to 3 of 3

Thread: Too much memory used?

  1. #1

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Too much memory used?

    I built my first Tower Defence game, and it works fine for the first little bit, but then, as you add more than 3 towers, and they start shooting, it gets extremely slow. I checked the Task Manager and it's taking up 28,000 K of memory. Don't you think that's a bit too much? There's no complicated processing or anything, everything is stored in a small structure. Could it be the images? I have no idea. What's wrong?!! None of my other games use even close to that much. It really shouldn't use that much memory, when I look at it. I also notice that 100% CPU is being used. How do I change the program to run efficiently?
    Attached Files Attached Files
    Last edited by minitech; Jul 23rd, 2009 at 09:05 PM.

  2. #2

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Too much memory used?

    Oh, and I changed it to a custom timer (on another thread), and it sped up, but it still experienced a huge slowdown about 50 seconds into the game.

  3. #3

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Too much memory used?

    I've merged more loops for efficiency, and it's faster now, but still... slow. Now, I also get an ArgumentOutOfRangeException (index out of bounds), and it says that the source line is Me.Invoke(tmr) inside Timer_Timer(). I'm assuming that it's coming from something the delegate calls, probably MoveAllX() where it does operations with loops, collections, indexes, etc. That would happen if I remove the last item in the list and then reference it by index, correct? I just can't find a spot where that happens. I'm also still stuck with the "slow" problem. Help, please!

    Changes are reflected in the updated Form1.vb attachment.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width