UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » How to check core dump memory usage(like heap memory )

#1 2013-03-19 06:16 AM

santoshkumar
Member
Registered: 2007-08-21
Posts: 53

How to check core dump memory usage(like heap memory )

Have core dump,

Although suspect it because of the memory leak from code,

From core backtrace cant figure it out was this the cause.

is there any gdb command or any utility command to check the memory used when core got generated.

How to confirm this was due to memory leak


Glimpse of backtrace of the core

#0  0x0000000000af40c7 in OS::TrapToDebugger () at ../../os_linux.cpp:4412
#1  0x0000000000af9385 in SaveDebugInfo (SignalNum=3, pSigInfo=0x7fffa937c5a0, pContext=0x7fffa937c470) at ../../os_linux.cpp:4057
#2  <signal handler called>
#3  std::_Rb_tree<unsigned int, std::pair<unsigned int const, CIFS_INCOMING_REQUEST*>, std::_Select1st<std::pair<unsigned int const, CIFS_INCOMING_REQUEST*> >, std::less<unsigned int>, __gnu_cxx::__pool_alloc<std::pair<unsigned int const, CIFS_INCOMING_REQUEST*> > >::find (this=0x3a18a28, __k=@0x7fffa937c8f8)
    at /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../include/c++/3.4.3/bits/stl_tree.h:494
#4  0x0000000000583e15 in CIFS_FILTER::GetNextOutgoingMID (this=0x3a17c60, SrcSide=FAST, pId=23735)
    at /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../include/c++/3.4.3/bits/stl_map.h:498
   
-------------------

Many Thanks for looking up .
Santosh

Last edited by santoshkumar (2013-03-19 06:19 AM)

Offline

#2 2013-03-19 08:46 AM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,230

Re: How to check core dump memory usage(like heap memory )

I don't know if there is such gbd command, but the quickest way to
see how much memory was used is to look at the core file size, because
it's a dump of all memory at the time of crash.

When a process is killed because of OOM then it's killed with SIGKILL.
Looking at your backtrace your signal seems to be signal 3, or SIGQUIT.
It seems it's send when you press Ctrl+\ when in console. If you didn't
do that, it gets more complicated:

http://www.mail-archive.com/xorg@lists. … 07800.html

Offline

#3 2013-03-19 11:42 AM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,829
Website

Re: How to check core dump memory usage(like heap memory )

If this is a background daemon process, I'd recommend ignoring SIGQUIT anyway...  It's one of the signals (along with SIGINT, SIGHUP, SIGWINCH, and SIGPIPE) I always ignore in a daemon...  (Actually, SIGPIPE I always ignore in clients as well...)

Offline

  • Index
  • » C
  • » How to check core dump memory usage(like heap memory )

Board footer

Powered by FluxBB