Memory profiling tool for Delphi?

I created a project and ran it, and looked at it in Process Explorer and found it was using about 5x more RAM than I would have guessed just to get started. Now, if my program is too slow, I hook it up to a profiler and tell me to use all my loops. Is there any similar tool with which I can plug it in and tell it to use all my RAM?

+2


source to share


4 answers


AQTime can help with this as well.



+6


source


What numbers are you using in Process Explorer?

"Memory usage" in Windows is not a simple topic. Nearly every application includes some sort of memory manager configuration that attempts to meet the memory needs of the application, which the operating system has surprisingly little value about - the OS knows what memory the application memory manager is using, but it's not always the same as what's on is actually using your application.

An easy way to see this is to observe the memory usage reported by the Task Manager. Start your Delphi application, note the "memory usage" in the task manager. Then hide this app in the taskbar and you will see a drop in memory usage. Even restoring the application again will not bring memory usage back to the previous level.

In rough terms, when you minify an application, the memory manager takes this as a signal that it should return any unnecessary "used" memory back to the OS. That is, memory that the memory manager uses to efficiently serve your application, but that your application does not actually use.

The memory manager must also return this memory to the system if the system requires it, due to a low memory state, for example. Minimizing the "trick" in the taskbar is just a smart optimization - since the minimized application is usually not actively used, it is a convenient time to do this "housekeeping" automatically.



(This is not "bad", it is just something to consider when considering "memory usage")

To make matters worse, in addition to the memory that the memory manager is using, but which is not your application, there is also a "commit charge" issue that will not necessarily show up as memory that is used by either your application or its memory manager!

In a Delphi application (since Delphi 2006) the memory manager is FastMM and has a built-in tool that will show you what your application memory is using from "internally" (or at least the tool for that - I didn't use it at the time) ...

iirc, this involved simply adding a unit to the project and creating a form at runtime (via some Debug Only menu item in the Help menu or any other mechanism) which would then give you a "map" of your memory usage ...

If you are using a version of Delphi before 2006, you can still use FastMM, which is free and open source. Just download it from sourceforge .

+4


source


AQTime has been a great profiling tool for us. It works surprisingly well, and allowed us to identify bottlenecks in places we never thought and were, while sometimes showing us there was no bottleneck where we were sure what was there.

It is, along with Finalbuilder, Araxis Merge and TestComplete, an indispensable tool!

0


source


In addition to the others: before I switched to D2006 + (and started using fastmm), I used AQTime free memproof. It has some problems, but it is functional.

0


source







All Articles