- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to use gdb to locate memory leak in source
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2004 03:39 AM
тАО11-23-2004 03:39 AM
1 3500 125 0x40d7f698 operator new [](unsigned long)()
2 1152 32 0x40edf160 operator new(unsigned long)()
3 216 6 0x40edec20 operator new(unsigned long)()
4 180 5 0x40edf190 operator new(unsigned long)()
7 144 4 0x40edf1c0 operator new(unsigned long)()
I like to know exactly in which source this constructor was called so I can assess the code and fix the leak.
However, just this constructor info is not specific enough for me to relate that to a specific source file. The program I am dealing with consist of hundreds of source files in many directories, and in a lot of different places constructors are called.
Also the 'info leak' output gives me address info, but if I interpret the data correctly it is a heap address and not a text address. So putting a breakpoint on this address so I can do a backtrace does not work because the program is never stopped by the breakpoint.
Does anybody have good idea's how I can set a smart breakpoint so I can get more detailed info in what source the leaks occur?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2004 03:52 AM
тАО11-23-2004 03:52 AM
Re: how to use gdb to locate memory leak in source
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2004 04:02 AM
тАО11-23-2004 04:02 AM
Re: how to use gdb to locate memory leak in source
'info leaks' only gives me the 'operator new' info which is not sufficient for me to find a unique source.
Is there a way gdb can give me more details? Can I make use of the address in the 'info leak' output?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2004 04:31 PM
тАО11-23-2004 04:31 PM
Solution(gdb) info leaks
This should print out more detailed leak report.
(gdb) info leaks
Scanning for memory leaks...
1000 bytes leaked in 1 blocks
No. Total bytes Blocks Address Function
0 1000 1 0x40429c30 operator new [](unsigned long)()
(gdb) info leaks 0
1000 bytes leaked at 0x40429c30 (100.00% of all bytes leaked)
in operator new [](unsigned long) ()
in f(void) () at test.C:4
in main () at test.C:8
in _start ()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2004 10:10 PM
тАО11-23-2004 10:10 PM