Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 60425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:09:36+00:00 2026-05-10T18:09:36+00:00

I’m trying to debug a memory leak problem. I’m using mtrace() to get a

  • 0

I’m trying to debug a memory leak problem. I’m using mtrace() to get a malloc/free/realloc trace. I’ve ran my prog and have now a huge log file. So far so good. But I have problems interpreting the file. Look at these lines:

@ /usr/java/ibm-java2-x86_64-50/jre/bin/libj9prt23.so:[0x2b270a384a34] + 0x1502570 0x68 @ /usr/java/ibm-java2-x86_64-50/jre/bin/libj9prt23.so:[0x2b270a384a34] + 0x1502620 0x30 @ /usr/java/ibm-java2-x86_64-50/jre/bin/libj9prt23.so:[0x2b270a384a34] + 0x2aaab43a1700 0xa80 @ /usr/java/ibm-java2-x86_64-50/jre/bin/libj9prt23.so:[0x2b270a384a34] + 0x1501460 0xa64 

The strange about this is that one call (same return address) is responsible for 4 allocations.

Even stranger:

@ /usr/java/ibm-java2-x86_64-50/jre/bin/libj9prt23.so:[0x2b270a384a34] + 0x2aaab43a1700 0xa2c … @ /usr/java/ibm-java2-x86_64-50/jre/bin/libj9prt23.so:[0x2b270a384a34] + 0x2aaab43a1700 0xa80 

Between those two lines the block 0x2aaab43a1700 is never being freed.

Does anyone know how to explain this? How could one call result in 4 allocations? And how could malloc return an address which was already allocated previously?

edit 2008/09/30: The script to analyze the mtrace() output provided by GLIBC (mtrace.pl) isn’t of any help here. It will just say: Alloc 0x2aaab43a1700 duplicate. But how could this happen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:09:36+00:00Added an answer on May 10, 2026 at 6:09 pm

    The function that is allocating the memory is being called more than once. The caller address points to the code that did the allocation, and that code is simply being run more than once.

    Here is an example in C:

    void *allocate (void) {   return (malloc(1000)); }  int main() {   mtrace();   allocate();   allocate(); } 

    The output from mtrace is:

     Memory not freed: -----------------            Address     Size     Caller 0x0000000000601460    0x3e8  at 0x4004f6 0x0000000000601850    0x3e8  at 0x4004f6 

    Note how the caller address is identical? This is why the mtrace analysing script is saying they are identical, because the same bug is being seen more that once, resulting in several memory leaks.

    Compiling with debugs flags (-g) is helpful if you can:

     Memory not freed: -----------------            Address     Size     Caller 0x0000000000601460    0x3e8  at /home/andrjohn/development/playground/test.c:6 0x0000000000601850    0x3e8  at /home/andrjohn/development/playground/test.c:6 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 153k
  • Answers 153k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The best approach should be like this if all the… May 12, 2026 at 10:24 am
  • Editorial Team
    Editorial Team added an answer You can get some ideas from this tutorial http://papermashup.com/jquery-ajax-delete/ Or,… May 12, 2026 at 10:24 am
  • Editorial Team
    Editorial Team added an answer Assuming you're running Django 1.1 or a fairly recent checkout,… May 12, 2026 at 10:24 am

Related Questions

I'm trying to detect memory leaks by globally overloading new and delete for debug
java version 1.5.0_14 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03) Java HotSpot(TM) Server
I'm still trying to debug a very sneaky memory corruption problem. I came across
Hey, I'm currently trying to send an image file to a web server using

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.