|
From: Shan M. <sha...@fr...> - 2005-04-19 09:45:32
|
Greetings, I would like to measure memory usage at given instants. My piece of softw= are allocates all its memory at the start (some of it dynamically) and I woul= d need to be able to perform a precise measurement of how much memory that is. I think massif could do the job, unfortunately it outputs only relative f= igures in the text file and the plot is not precise enough to read the figures. = Would the massif.pid.hp be helpful ? How can I keep it around (ie. disable the production of ht graph) ? Thanks, Shan |
|
From: Nicholas N. <nj...@cs...> - 2005-04-19 13:13:16
|
On Tue, 19 Apr 2005, Shan Mignot wrote:
> I would like to measure memory usage at given instants. My piece of software
> allocates all its memory at the start (some of it dynamically) and I would need
> to be able to perform a precise measurement of how much memory that is.
What exactly do you mean by "memory" here -- the heap, the stack, static
code and data, mmap'd regions? Depending on the answer, it may be easier
to computer the memory usage yourself within your program.
> I think massif could do the job, unfortunately it outputs only relative figures
> in the text file and the plot is not precise enough to read the figures. Would
> the massif.pid.hp be helpful ? How can I keep it around (ie. disable the
> production of ht graph) ?
The below patch will avoid deleting both the .hp and the .aux files.
N
Index: massif/ms_main.c
===================================================================
--- massif/ms_main.c (revision 3532)
+++ massif/ms_main.c (working copy)
@@ -1489,8 +1489,8 @@
"Conversion to PostScript failed. Try converting
manually.");
} else {
// remove the .hp and .aux file
- VG_(unlink)(hp_file);
- VG_(unlink)(aux_file);
+ //VG_(unlink)(hp_file);
+ //VG_(unlink)(aux_file);
}
VG_(free)(hp_file);
|