Thread: Still Clueless malloc rant - part deux

  1. #1
    Registered User
    Join Date
    Oct 2023
    Posts
    18

    Still Clueless malloc rant - part deux

    Why is it that so many running app grow in memory and only release memory when they quit ?


    Quote Originally Posted by christop
    3. Many possible reasons. Could be that they don't release memory that's no longer needed. Could be they have an ever-growing cache of stuff (cache invalidation is hard). Could be they use exponential reallocations with a growth factor close to or greater than ϕ (see, e.g., math - What is the ideal growth rate for a dynamically allocated array? - Stack Overflow). Could be they just have plain ol' memory leaks.

    free does not necessarily release the memory back to the operating system. Most often it just puts back that memory area in a list of free blocks. These free blocks could be reused for the next calls to malloc.
    c - Why free() doesn't really frees memory? - Stack Overflow

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    What are you babbling about?

    > Why is it that so many running app grow in memory and only release memory when they quit ?
    References please.
    Otherwise, this is just heresay.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. clueless malloc rant 2023
    By upload in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2023, 06:06 PM
  2. Replies: 4
    Last Post: 05-30-2011, 04:52 PM
  3. Processing Bitmap Data (part deux)
    By bartus0 in forum Windows Programming
    Replies: 2
    Last Post: 12-10-2010, 01:36 AM
  4. Should it be legalized - Part Deux
    By medievalelks in forum A Brief History of Cprogramming.com
    Replies: 124
    Last Post: 06-11-2008, 06:17 AM
  5. Cprog Fantasy Football Part Deux
    By Govtcheez in forum A Brief History of Cprogramming.com
    Replies: 391
    Last Post: 01-03-2005, 11:11 AM

Tags for this Thread