News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Memory leakage tool

Started by Biterider, April 07, 2005, 12:32:14 PM

Previous topic - Next topic

Brett Kuntz

I was under the impression windows unallocated all memory when an application exited anyways? I mean if you make a simple program allocated 512mb's of ram, run it, ctrl-alt-del and check your memory, you'll notice it went down by 512mb's. Exit the app (without deallocating) and it'll go away and you'll have your 512mb's back.

pbrennick

Biterider,
Memleak has problems.  If a debugger is not found by the app, when the app closes, it leaves a messagebox stating that error running and it will not go away.  Every time you try to close it, it reopens itself.

BTW:  kuntor, this error proves your assumption is incorrect for 'all' cases.  Windows will not force down a process left running, as is happening here.  Download his app and try it.

Paul

Biterider

Hi pbrennick
You have to install the ObjAsm32 package where the debug window is present to display the output messages. As said before, the MemLeak app is only to show the first step and to see if it is possible. If you want to work without the debug window, strip away the DbgXXX macros and redirect the output to the console or better to a MessageBox. My tip is to examine carefully the IMT32Hook object.  :8)
Regards,
Biterider

pbrennick

Actually, I have installed the package.  And it is installed in the default location (except it is on the d: drive.  ObjAsm32 asks where masm32 is installed and from there I just let it do its thing.  I am testing your executable, not a recompilation so the problem is there.

Paul

pbrennick

bTW:  Even if the package is not installed your app should check for that and not generate endless messageboxes.

Paul

Biterider

Hi pbrennick
A fast solution for this problem is to start DebugCenter.exe and the MemLeak.exe.
Can you check if in your system the environment variables OA32_Path and Masm32_Path are defined?
I think that the problem is that the path to the DebugCenter is statically linked into the MemLeak.exe. I'll see how to solve it definitively...  :wink
Regards,
Biterider

Biterider

Hi pbrennick
I have made some changes in the Debug routines to solve the problem. Now the DebugCenter path is determined at runtime based on the OA32_PATH environmental variable. If the .exe is not found, an alert messagebox is shown only once...  :toothy
If it works, I'll upload the changed sources.

Regards,
Biterider


[attachment deleted by admin]

pbrennick

Yeah, there are no environment variables set on my machine.  I used to set them but I have multiple programming languages installed and it became a real problem at times and now I just wont do it, even if they appear to be unique.

Paul