Valhalla Legends Forums Archive | Visual Basic Programming | Memory Leaks

AuthorMessageTime
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.
August 26, 2005, 1:39 AM
R.a.B.B.i.T
Check your arrays ;\
August 26, 2005, 2:40 AM
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.
August 26, 2005, 3:56 AM
LoRd
Unless the overall memory usage is slowly increasing then it's probably not a memory leak, rather just poor coding.
August 26, 2005, 4:09 AM
Topaz
Examples of how this could happen? It might just be me :(
August 26, 2005, 4:11 AM
UserLoser.
[quote author=LoRd[nK] link=topic=12623.msg125507#msg125507 date=1125029393]
Unless the memory is slowly increasing in memory usage then it's probably not a memory leak, rather just poor coding.
[/quote]

Or poor coding which leads to memory leaks
August 26, 2005, 4:11 AM
UserLoser.
[quote author=Topaz link=topic=12623.msg125508#msg125508 date=1125029488]
Examples of how this could happen? It might just be me :(
[/quote]

Not closing handles, threads, deleting objects, freeing up arrays, etc. when you're done with them
August 26, 2005, 4:12 AM
R.a.B.B.i.T
It could possibly be 3rd party ActiveX controls you're using as well.
August 26, 2005, 6:23 AM
Topaz
What sort of things (attributing to poor coding) would suck up a lot of memory?
August 26, 2005, 3:27 PM
UserLoser.
[quote author=Topaz link=topic=12623.msg125562#msg125562 date=1125070028]
What sort of things (attributing to poor coding) would suck up a lot of memory?
[/quote]

Not closing handles, threads, deleting objects, freeing up arrays, etc. when you're done with them
August 26, 2005, 8:38 PM
Grok
[quote author=Topaz link=topic=12623.msg125487#msg125487 date=1125020366]
and I don't set objects to Nothing after using them.
[/quote]

Why not?  Depending on your scoping and object creation, that could be your problem.  What type of objects?
August 31, 2005, 4:55 AM

Search