How to get amount of memory a program is using 
Author Message
 How to get amount of memory a program is using

All,
    I am running into an error and I want to be able to write to a log the
amount of memory my program is using when it happens.  Anyone know how to do
this?

--
Gary A. Bushey                | When you seek it,



Sun, 08 Apr 2001 03:00:00 GMT  
 How to get amount of memory a program is using
Hi Gary,

You can try using the GlobalMemoryStatus API.  A sample can be found in this
article

HOWTO: Get Windows Status Information via API Calls
Article ID: Q161151

HTH
--
Dev Ashish    (Just my $.001)
The Access Web ( http://home.att.net/~dashish )
----

:All,
:    I am running into an error and I want to be able to write to a log the
:amount of memory my program is using when it happens.  Anyone know how to
do
:this?
:
:--
:Gary A. Bushey                | When you seek it,

:
:
:



Sun, 08 Apr 2001 03:00:00 GMT  
 How to get amount of memory a program is using

|All,
|    I am running into an error and I want to be able to write to a
log the
|amount of memory my program is using when it happens.  Anyone know
how to do
|this?
|

Here's a quick snapshot sample of how to use GlobalMemoryStatus:

Private Type MEMORYSTATUS
    dwLength As Long
    dwMemoryLoad As Long
    dwTotalPhys As Long
    dwAvailPhys As Long
    dwTotalPageFile As Long
    dwAvailPageFile As Long
    dwTotalVirtual As Long
    dwAvailVirtual As Long
End Type

Private Declare Sub GlobalMemoryStatus Lib "kernel32" _
   (lpBuffer As MEMORYSTATUS)

Private mMS As MEMORYSTATUS
Private mMemoryUsed As Long
Private mTotalPhysicalMemory As Long
Private mAvailablePhysicalMemory As Long
Private mTotalPagingFile As Long
Private mAvailablePagingFile As Long

Public Sub GetStatus()

   mMS.dwLength = Len(mMS)
   GlobalMemoryStatus mMS

   'fill properties
   mMemoryUsed = mMS.dwMemoryLoad
   mTotalPhysicalMemory = mMS.dwTotalPhys
   mAvailablePhysicalMemory = mMS.dwAvailPhys
   mTotalPagingFile = mMS.dwTotalPageFile
   mAvailablePagingFile = mMS.dwAvailPageFile

End Sub

;-) Cool
Hasta Luego
Adrian Maull, MCP
(author of the amDeveloper Bar
www.middlebay.com/amware)



Sun, 08 Apr 2001 03:00:00 GMT  
 How to get amount of memory a program is using
Check out the code at:

http://www.geocities.com/siliconvalley/6304/css

Free!

Quote:

>All,
>    I am running into an error and I want to be able to write to a log the
>amount of memory my program is using when it happens.  Anyone know how to
do
>this?

>--
>Gary A. Bushey                | When you seek it,




Tue, 10 Apr 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Amount of ram used by embedded VB program using inclueded db engine

2. Changing the amount of memory for programs

3. Getting IP Address on machine I am using

4. Help - I am getting an error using data control

5. I am using the Compare MS Project COM Program and having issues

6. Retrive amount of system memory?

7. how to get amount of Memory available

8. how to get amount of Memory available

9. How to get amount of memory allocated for types

10. I am trying to update a record, i am not using data control

11. I am trying to update a record, i am not using data control

12. Change Monetary Number Amount Into Corresponding Monetary Word Amount - Access 97

 

 
Powered by phpBB® Forum Software