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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:24:54+00:00 2026-05-20T19:24:54+00:00

My program use a lot of memory. This is what valgrind massif tool is

  • 0

My program use a lot of memory. This is what valgrind massif tool is showing me:

--------------------------------------------------------------------------------
  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
--------------------------------------------------------------------------------
 28 38,531,086,036      760,235,208      143,002,822   617,232,386            0

As you can see extra part is few times bigger than useful heap.

What should I do to reduce this extra memory?
Do less allocations?

Is this so called memory fragmentation?

OS: Linux 2.6. Program is written in C. It should work 24\7 and it manipulate a lot of data.

  • 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-05-20T19:24:54+00:00Added an answer on May 20, 2026 at 7:24 pm

    Are you allocating lots of extremely small objects — say, just a couple of bytes? There’s a certain amount of overhead associated with every allocation (because, e.g., free needs to be able to tell how big the block was).

    This is what’s sometimes called “internal fragmentation”, as opposed to “external fragmentation” where there’s a certain amount of unallocated memory but you can’t use it because it’s split up into blocks that are too small for you to use. (Another reason why malloc doesn’t ever return really small blocks is because this helps reduce external fragmentation.)

    If you are allocating lots of very small objects, you should consider managing them separately rather than allocating them individually on the heap. This may well be better in other ways too (e.g., improving memory locality) if you do it right.

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

Sidebar

Related Questions

use this website a lot but first time posting. My program creates a number
I use a program call php easy calendar. Into that, there is a lot
This program I use has it's own variables to set when you run it,
I have a really large loop in my program, and I use a lot
So I have this Java program that I use to munch through several terabytes
Currently, my program have a lot of sessions at memory. Session is the object
My program use UdpClient to try to receive 27 responses from 27 hosts. The
I'm making a program use JNI to call some native directives. My code is:
I have a flight reservation program use mssql ,For reserving flights i want to
In my program I use WebBrowser control for OAuth. It's located on vk_auth_window form.

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.