Re: Memory of the process
Before running the program start Resource meter and check how much memory your app uses. You will find recource meter in Program/Accescories/System Tools.
Iouri Boutchkine
[email protected]
Re: Memory of the process
Actually, this wouldn't have been useful.
I found everything I needed with the GetProcessMemory API function...
For readers:
Type PROCESS_MEMORY_COUNTERS
cb as Long
PageFaultCount as Long
PeakWorkingSetSize as Long
WorkingSetSize as Long
QuotaPeakPagedPoolUsage as Long
QuotaPagedPoolUsage as Long
QuotaPeakNonPagedPoolUsage as Long
QuotaNonPagedPoolUsage as Long
PagefileUsage as Long
PeakPagefileUsage as Long
End Type
private Declare Function GetCurrentProcess Lib "kernel32" () as Long
private Declare Function GetProcessMemoryInfo Lib "psapi.dll" (byval lHandle as Long, lpStructure as PROCESS_MEMORY_COUNTERS, byval lSize as Long) as Integer
and in your function:
Dim lngReturn as Long
Dim typMem as PROCESS_MEMORY_COUNTERS
lngReturn = GetProcessMemoryInfo(GetCurrentProcess(), typMem, len(typMem))
Debug.print CStr(typMem.WorkingSetSize)
This works like a charm...! I found the ADO connection was leaking memory for some reason... even if I closed it and set it to nothing!