Solved

Memory used by My app

Posted on 2000-05-04
3
130 Views
Last Modified: 2010-05-02
I can get the total memory or free memory using APIs.

I need some API to get the memory used by MY APPLICATION.

0
Comment
Question by:shahidi
  • 2
3 Comments
 
LVL 14

Expert Comment

by:wsh2
ID: 2779589
As Visual Basic dynamically uses / frees memory as it runs.. getting just the MY APPLICATION memory requirements is NOT going to be easy. The best you can do is take a Free Memory reading in an empty machine before loading your program, and then do a Free Memory API in your program after loading everything you possibly have in it.

Additionally please note.. that some of the underlying DLL's that VB uses are shared between multiple instances of running VB applications. If you Load MY APPLICATION once.. take a memory reading.. and then Load it a second time.. the memory usage readings in the second instance will be less as it is sharing resources that were loaded by the first instance of MY APPLICATION.

0
 

Author Comment

by:shahidi
ID: 2780140
OK can i get the memory used by one process...
Thanks
0
 
LVL 14

Accepted Solution

by:
wsh2 earned 50 total points
ID: 2780247
Do a free memory API before "SHELL"ing to it from a VB program and then start a timer that periodically monitors free memory recording the Maximum differences. Assuming Windows does not launch too many behind the scenes system tasks while you are doing this.. you can get an idea of how much memory is consumed.

Note: If you take a memory reading before launching your VB memory monitor, and then compare it to the VB memory reading you got before "SHELL"ing, you can get an idea of what size the base VB load modules are consuming.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now