On Wed, 2015-11-25 at 13:32 +0800, yoma sophian wrote: > hi philippe > > > massif does not provide information about where memory was freed. > > It shows the memory used by your program, and where it was allocated. > > > > For what reason do you want to know where some memory was freed ? > if there is no free information output by massif, how could > massif-visualizer show the heap memory usage decreased with thinner > color bar if some function call free? > (take the web side sample for example, the color of main in > massif-visualizer will get thinner at the end of UI output) > I cannot see any free information in the ms_print I do not know to what color bar you refer, but I guess that the decrease of memory is detected by comparing 2 successive snapshots. Massif records the stack trace of each malloc, and for each such stacktrace, maintains the memory (still) allocated by this stack trace. In other words, massif observes the free calls to decrease the memory allocated by a stacktrace, but massif does not record the stacktraces that are calling free, and does not maintain stats about such 'free stacktraces'.
Maybe you could explain why you need to have the free stacktraces ? This might maybe point at other tools (memcheck ? callgrind ? dhat ?) that will help to achieve what you need/want. > > > You are welcome. Note that such type of questions is well suited > > on valgrind-users. valgrind-developers is more used for questions > > about valgrind development itself. So, no need to send the question > > on both mailing lists. > > Originally I thought maybe my question may nedd to modify source or > compile option. > Sorry for sending to 2 mailing lists ^^ > > BTW, I found the massif output seems only created when program exit. > > is there any option or some modifification for valgrind to generate > massif.out in a period of time or by specific event, such as user add > special code in program or press specia button, etc? > Since I am using valgrind to profile a daemon heap usage when it > runing before and after some specific function, but > that mean I have to kill the daemon before and after running function. > And that is quite inconvinent. You can trigger massif snaphots, using massif monitor commands either: * from the shell, using vgdb * from gdb, using gdb+vgdb * from your program, using the client request VALGRIND_MONITOR_COMMAND(command) See http://www.valgrind.org/docs/manual/ms-manual.html#ms-manual.monitor-commands for the list of massif monitor commands. 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=254741551&iu=/4140 _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users