• Welcome to Valhalla Legends Archive.
 

Memory Leaks

Started by Topaz, August 25, 2005, 08:39 PM

Previous topic - Next topic

Topaz

My bot that I'm currently coding is experiencing memory leaks, or at least, that's what I think. :P It was 2,000k before, and it's done a nice leap to about 7,000k :-/

So, in short, I'd like for you guys to post what you know ( Possible places/reasons why it's leaking, or methods for me to find and kill them )

Note: I do use Option Explicit, and I don't set objects to Nothing after using them.

R.a.B.B.i.T


R.a.B.B.i.T

Adding stuff repeatedly, bad methods of checking, not properly deleting data, etc...  IE: If you have a string array of users, and one leaves, you remove that data from the array (data(50) = "" or whatever), but the space is still allocated, so each time you add a new user, you're allocating more space, even though you may not need to.

Eric

#3
Unless the overall memory usage is slowly increasing then it's probably not a memory leak, rather just poor coding.

Topaz

Examples of how this could happen? It might just be me :(

UserLoser.

Quote from: LoRd[nK] on August 25, 2005, 11:09 PM
Unless the memory is slowly increasing in memory usage then it's probably not a memory leak, rather just poor coding.

Or poor coding which leads to memory leaks

UserLoser.

Quote from: Topaz on August 25, 2005, 11:11 PM
Examples of how this could happen? It might just be me :(

Not closing handles, threads, deleting objects, freeing up arrays, etc. when you're done with them

R.a.B.B.i.T

It could possibly be 3rd party ActiveX controls you're using as well.

Topaz

What sort of things (attributing to poor coding) would suck up a lot of memory?

UserLoser.

Quote from: Topaz on August 26, 2005, 10:27 AM
What sort of things (attributing to poor coding) would suck up a lot of memory?

Not closing handles, threads, deleting objects, freeing up arrays, etc. when you're done with them

Grok

Quote from: Topaz on August 25, 2005, 08:39 PM
and I don't set objects to Nothing after using them.

Why not?  Depending on your scoping and object creation, that could be your problem.  What type of objects?