From: yoma s. <sop...@gm...> - 2015-12-07 03:49:20
|
hi Philippe: > There is no free information in the massif outputs. > massif only produces a sequence of snaphots, each snapshot gives > the memory still allocated at the snapshot time. > > The memory allocated by main returns to 0, because all the memory > allocated by main is freed. The graph effectively shows the absolute > value of the memory allocated at the snapshot time. > massif does not record the free stacktraces, it only records how > much memory is allocated by a stacktrace (and this amount decreases > when free is called). > > So, in summary: > * massif does *not* record 'free' stacktraces > * massif *only* record 'malloc' stacktraces > * massif maintains the memory allocated by a stacktrace > this amount is decreased when free is called. > > So, do not expect to find some details about free stacktraces, as these > are not recorded. Thanks for your kind explination ^^ > > I think there is a bug in the massif logic to make a peak detailed > snapshot at the moment of munmap: it should try to produce a peak > snapshot when releasing the first page of munmap, not when releasing > the last page. I use vgdb and try to create snapshop with command, "monitor detailed_snapshot xxx" No matter I create snapshop before mmap or after mmap, I hightlight in the below program, there is still no mmap information in the detail snapshop file. It seems the mmap is not recorded by massif even I manual trigger the snapshop. If I miss anything or do any wrong experiment, please let me know. appreciate your kind help, f(); g(); /****break Here*****/ p = mmap (0, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); if (p == MAP_FAILED) { /****break Here*****/ perror ("mmap"); return 1; } |