On Mon, 2015-12-07 at 00:08 +0800, yoma sophian wrote:

> I attach the pic, massif_test.png I got from massif-visualizer, and in
> the pic, the heap allocated by main will decreased to 0.
> But f and g these 2 functions will not.
> What makes me curious is I cannot find the free information in the
> massis output ascii file.
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.


> BTW, I have some questions about --pages-as-heap=yes
> I purposely write a  program, mmap.c, that will  map the file into the memory
> But from ms_print of mmap.c, mmap_4440, I cannot see the location of
> mmap I put in the c file.
> (I attach the c file and mass output as well)
> Shall we add more options to see the location of mmap in the program
> when enable  --pages-as-heap=yes?
The stack is only output for detailed snaphots. I believe that no
detailed snapshot is taken between the mmap and the munmap.

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.

Philippe



------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to