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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:44:33+00:00 2026-06-06T08:44:33+00:00

glibc’s malloc implementation supports ‘malloc_trim()’ call that lets an application program release unused(ie freed

  • 0

glibc’s malloc implementation supports ‘malloc_trim()’ call that lets an application program release unused(ie freed memory chunks) back to the system(implementation detail: the data segment of the program is reduced by calling sbrk() with a negative argument). However, this function only works with the main arena. In multithreaded programs, there are multiple arenas that hold freed chunks. Why does this call not release memory from the other arenas as well?

  • 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-06T08:44:34+00:00Added an answer on June 6, 2026 at 8:44 am

    Arenas other than the main one are probably allocated from the system using mmap so sbrk cannot be used to return that memory to the system. It could be possible to make glibc use mremap to shrink these other arenas. Note also that malloc_trim can only return memory at the end of the arena, if there are empty blocks in the middle of the arena there’s no way to release that memory.

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

Sidebar

Related Questions

I'm getting *** glibc detected *** (/my/program/...): malloc(): memory corruption: 0xf28000fa *** I've run
in glibc malloc.c for calloc() (precisely, public_cALLOc()) implementation, when it tries to 0 out
I'm trying to print call stack from within a program. Unfortunately, call to glibc
We have a new application that requires glibc 2.4 (from gcc 4.1). The machine
A call to clear on a QByteArray generates the following exception: * glibc detected
* glibc detected * malloc(): memory corruption (fast): *** This is the error I
In glibc malloc.c or dlmalloc It said repositioning tricks As in blew, and use
after going through glibc code for malloc() and the actual allocator i.e _int_malloc() function
Have run into a bug with glibc's malloc(): http://sourceware.org/bugzilla/show_bug.cgi?id=4349 and am thinking a work
How is Linux simultaneously 32bit and 64bit? Or is that something handled in glibc?

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.