Click to See Complete Forum and Search --> : Need an expert on memory optimization
mwdelta
Jul 5th, 2000, 08:21 PM
I'm working on a program that keeps track of your projects and how much time you spend on them. The problem I'm having is that it uses lots and lots of memory. I need someone with lots of VB experience to tell me what is using so much memory and help slim down the code. Please email me if you think you might be able to help.
kb244
Jul 6th, 2000, 09:48 AM
Well if at all possible, you can email it to me, or least tell me how you are using it. would like to know the size of the project(source code wise). when you say huge, do you mean huge in memory(Ram) or huge on disk after it has been compiled, if its on rams, I would think you possibly have a loop in there creating new data types all the time, and never killing the old ones, or all your data types are variants (variant strings can take up a huge ammount of memory compared to other data types)
mwdelta
Jul 6th, 2000, 01:45 PM
I'll get back to you in a few days...I just released a beta to the internal QA team. I'm talking memory usage here. The main program uses about 9MB of RAM under Windows 2000, according to Task Manager. Compiled the program is less than 1MB, and I use a ExePacker so it's only 220K when compressed. Source-code wise, it's approaching 10000 lines. I have tried to declare most variables, but there may be some that are variants, although I'm not sure that it would make that big of a difference. There can't be that many Variants other than temporary variables. I'm not sure about the loops part, although I have tried to keep control over those. I'll email you the address where you can download the compiled version, for the time-being.
Thanks, Mike
Crypt
Jul 7th, 2000, 11:12 AM
I'm no expert on memory usage but heres a little bit of info on how much space a data type takes up in memory.
an Integer takes up 2 bytes of memory.
Long 4 bytes of memory,
Single Positive uses 4 bytes of memory
Single Netagtive uses 4 bytes
Double positive 8 bytes
Double Negative 8 bytes
Currency 8 bytes
String it depends on how many characters are in the string
also a variants like kb244 said take up more bytes,
so it all depends on how many string, or what ever, you have in your project, and like kb244 also said you may have a loop continuely creating new data types which would guzzle a lot of a computers memory.
Dax
Aug 20th, 2000, 04:10 PM
I've optimized many software.
ITs a bit difficult to say anything. If I can see the source code, I can maybe help. Sometimes, small things can do great things.
I'm also gonna write an article right here at http://www.vb-world.net maybe about mem optimization soon.
Mail me at dpandhi@yahoo.com and maybe we can talk bout it.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.