Cyclone comes with a tool, aprof, that helps to debug allocation. To get a profile of the allocation behavior of a Cyclone program, follow these steps:

  1. Compile the program with the flag -pa. The resulting executable will be compiled to record allocation behavior. It will also be linked with a version of the standard library that records its allocation behavior. (If you get the message, “can’t find internal compiler file libcyc_a.a,” then ask your system administrator to install the special version of the library.)

  2. Execute the program as normal. As it executes, it will write to a file amon.out in the current working directory; if the file exists before execution, it will be overwritten.

  3. Run the program aprof. This will examine amon.out and print a report on the allocation behavior of the program.