This is the instrumentation tool developed with Phoenix SDK Pre-release July 2007 for porting PAMM to windows platform. This tool can work well with the managed binary code written in either C# or managed C++. The instrumented code is supposed to check whether to invoke a garbage collection after a certain amount of new objects are created during the runtime, depending on the current memory usage information acquired from .net virtual machine.

Basic Manual

Acquiring the Code
The code can be checked out through svn with either of the two commands:
  • svn co file:///p/compiler/repos/PAMM_Phx_Jul07/trunk PAMM_Phx_Jul07
  • svn co svn+ssh://login@<cs-machine-name>/p/compiler/repos/PAMM_Phx_Jul07/trunk PAMM_Phx_Jul07

Project Directory
The project contains two sub-directory:
  • PAMM_Phx is the directory containing the source code of the main instrumentation tool including reading and writing managed binary and code injection.
  • PAMM_Handle is a DLL library which will be called by the instrumented binary to check the memory usage and call a garbage collection if necessary.
The already built executables are included in the subdirectory named bin.
Instrumenting a Managed Binary
To use PAMM_Phx to instrument a managed binary application, the Phoenix SDK should be installed on the computer. The package can be downloaded for free from Microsoft. Make sure you have the PAMM_Phx.exe, PAMM_Handle.dll ,and the application to be instrumented in the same directory to make the tool work properly. To instrument a managed binary application, simply type in the following instruction in the Phoenix SDK command prompt environment:
  • PAMM_Phx /in <filename> /num [num_obj] /mem [mem_bound]
    • /in is the filename of the application to be instrumented
    • /num [num_obj] should be an integer number greater than 0. This is to specify the number of new objects before a memory check. In other words, during the runtime, a memory check is performed every num_obj new objects are created. If not provided, the default number will be set to 5000.
    • /mem [mem_bound] should be an integer number not less than 0. This is to specify the memory upper bound for the application during the runtime and the current unit is megabyte. When a memory check is performed, if the memory used by the application exceeds mem_bound MB, a garbage collection on the heap will be forced. The default value for this parameter is 0, which means there is no manually set upper bound and the .net virtual machine is in charge of the memory management.
After the instrumentation is done, a new binary code will be generated in the name of the application with a "-pamm" suffix attached.
Rebuilding the project
The project is created in Visual Studio 2005 ,and written in C#, a solution file may be found under the two subdirectories respectively. One can simply load the solution file into Visual Studio 2005, or Visual C# Express 2005, make whatever modification, and then rebuild it without any difficulty. Keep in mind that, to successfully rebuild PAMM_Phx, the Phoenix SDK is required and the current release of Phoenix SDK does not support Visual Studio 2008 or Visual C# Express 2008.
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2008-01-31 - JiashengShi
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback