_memory_profile - It shows the amount of memory used by every pacakge. _________________________________________________________________ _memory_profile [-f ] [-h] [-p] [-u ] This command intregrates the output from purify with a function map generated by a perlscript plus another perlscript to generate a memory profile of vis. This command relies on the output of purify to a file to call the script "memoryaccount" and produce a summary of how much memory has been allocated by each package. Although this command may appear simple it requires the interaction of two scripts and three files, so special care should be taken when attempting to modify it. Here is the way it works. The code in this command is conditionally compiled depending on the definition of the symbol PURIFY. If the symbol is not defined, the program prints a message notifying that the command is not operative in this executable. If PURIFY has been defined, there are certain things that are assumed. The executable has been linked with purify. The output of purify is being redirected to a file with name purify.log. The perl script memoryaccount is in $VIS/common/share and it is executable. There exists a file mapping function names to packages in the same place whose name is .fmap. The command then calls purify_all_inuse() to force purify to dump to the file purify.log the information about the memory that is currently visible to the program. This memory is not the total memory allocated by the program since there may be leaked memory that is no longer accessible. A temporary file is created and the script memoryaccount is called to analyze the file purify.log and write in the temporary file the memory profile obtained from it. Once the script is done, the temporary file is dumped to vis_stdout and deleted. Since most of the computation in this command is done by the pearlscript memoryaccount, for more information please refer to the message printed when the script is invoked with the option -h. Command options: -f File to read the dump from. The default is purify.log. This option should be used if and only if the option -log-file has been used at the linking stage when building the executable. -h Print the command usage. -p Print also the packages that did not allocated any visible memory -u Units to print the memory usage in. It may be "b" for bytes, "k" for kilobytes, "m" for megabytes and "g" for gigabytes. The default is bytes. _________________________________________________________________ Last updated on 20100410 00h02