954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to measure memory consumption of a VB 6.0 programe?

Dear Sir/Madam,

How to measure memory consumption of a VB 6.0's programe?

As a programmer in vb. 6.0, where i have to be conscious for getting less consumption of memory of my program at design time?

Is there any free software to measure memory consumption of a programe?

Please guide me Sir/Madam

P.manidas
Posting Whiz
304 posts since Oct 2008
Reputation Points: 53
Solved Threads: 14
 

Hi P.manidas,
What type of memory you want to read/measure? Do you mean to say Memory used for storing or memory used while running your program?

Thanks

kinwang2009
Posting Whiz in Training
243 posts since Feb 2010
Reputation Points: 17
Solved Threads: 42
 

Hi P.manidas, What type of memory you want to read/measure? Do you mean to say Memory used for storing or memory used while running your program?

Thanks

Dear Kinwang2009,

Here i am asking about 2nd one. How much memory will be consumed at the time of running the programe.

Thank you for your query.

P.manidas
Posting Whiz
304 posts since Oct 2008
Reputation Points: 53
Solved Threads: 14
 

Time to use your friends (yahoo, google, ask, answers, bing) and search for vb6 ReadProcessMemory or you could use the task manager to see how much your program takes up in memory...

Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

Time to use your friends (yahoo, google, ask, answers, bing) and search for vb6 ReadProcessMemory or you could use the task manager to see how much your program takes up in memory...

Good Luck

Dear vb5prgrmr,

First of all thanks for your reply, vb4prgrmr.

As you have written, i have seen in the Task Manager regarding memory used by the programe. If it shows perfect result, then it's OK.

And what about the precaution to take at design time for less memory consumption by the programe/software? And rest of all i will search with my friend as you have written.

Thank you

P.manidas
Posting Whiz
304 posts since Oct 2008
Reputation Points: 53
Solved Threads: 14
 

Precautions in designtime to consume less memory... (you would watch the vb6.exe memory consumption in debug mode...)

Use control arrays as much as possible.
Don't over crowd forms with controls.
If you can, put as much code into modules and classes as you can as the forms graphical elements take up a lot of memory.
When using data access methods and you have a table with an extreme amount of records, don't use a select * unless you absolutly have to for your program.
When you can unload formname/set formname = nothing to totaly remove it from memory.
And this goes with the one above... Don't use public variables in the forms because if you need access to the information contained within that variable, you have to keep at least part of the form loaded. So put the public variable in a module and that way you will have access to it from everywhere when you need it.
Don't load an excessive amount of graphics into memory (icons, who cares, but pictures like bmp's, jpeg's, and the like, yeah you gotta watch those).
The same thing can be said about files you open up, meaning text files and such that you open with the Open Method.
When you can, use an image control instead of a picturebox control or a label instead of a textbox... i.e. use the lightest weight control you can for the purposes needed at hand...

Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

Dear vb5prgrmr,

Thank you for your reply with lot more information. It's really help me.

Thank you vary much.

P.manidas
Posting Whiz
304 posts since Oct 2008
Reputation Points: 53
Solved Threads: 14
 

Not a problem, now if this is solved could you please mark it as so...

Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

No problem.

P.manidas
Posting Whiz
304 posts since Oct 2008
Reputation Points: 53
Solved Threads: 14
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: