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 7950887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:24:13+00:00 2026-06-04T02:24:13+00:00

I have an issue with my program using much more memory than I think

  • 0

I have an issue with my program using much more memory than I think it should

I’ve used valgrind and it has been a godsend for discovering memory problems such as buffer overruns and memory leaks

Problem I have here is that it doesn’t look like its a leak, just usage that is inconsistent with what I think it should be

Is there another tool that you can use to monitor memory usage in the same way you might monitor variable values using a debugger such as gdb?

massif has told me that the lion share of the heap memory is being allocated via this statement:

->98.80% (1,338,700,288B) 0x40341D5: caa (caa.c:196)

the statement being a call to push an element on to a UT_array, e.g.

utarray_push_back(utarr_ctr_pdws, &pdw);

pdw is a pointer to a struct and is a stack variable

So it would seem the memory that UT_array is mallocing isn’t getting freed, but I have another statement a few lines down explicitly doing this:

utarray_free(utarr_ctr_pdws);

The UT_array is just an array of pointers therefore doesn’t need any additional dtor function defined in the UT_ICD helper struct.

If anyone has any experience of using UT_arrays maybe you can shed some light on why its using up so much memory?

  • 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. Editorial Team
    Editorial Team
    2026-06-04T02:24:14+00:00Added an answer on June 4, 2026 at 2:24 am

    valgrind massif is the answer here, its a heap memory analysis tool (see http://valgrind.org/docs/manual/ms-manual.html)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there have been similar questions posted but I think the issue I'm
I have been designing a program using Visual C# and have came across an
I have been using instruments to check for leaks and other memory issues in
I have discovered some issues in my program. I was using log4j for logging,
I have run into a small issue in my program. I have a class
I have an issue with a simple program. I'm opening a QFileDialog this way:
I have the following question. I've done a program in C++ using OpenCV. I
i am writing a C program and one of the issues i have is
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
We are new to ROR, We have issue in creating Login/Logout process in ROR

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.