public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "phil dot pratt dot szeliga at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/10756] free doesn't free all memory alloced by memalign
Date: Sun, 11 Oct 2009 15:04:00 -0000	[thread overview]
Message-ID: <20091011150442.27315.qmail@sourceware.org> (raw)
In-Reply-To: <20091011145743.10756.phil.pratt.szeliga@gmail.com>


------- Additional Comments From phil dot pratt dot szeliga at gmail dot com  2009-10-11 15:04 -------
(In reply to comment #0)

Oops.  the main line should be "int main(int argc, char * argv)" as usual.
This code originally came from the Cell BE Processor.

> free doesn't free all memory alloced by memalign.  This is causing my
> program to run out of memory, even though I am freeing old memory.
> This bug exists in newlib too.
> 
> code example:
> =======================================
> #include <malloc.h>
> #include <stdio.h>
> 
> static void printMemUsage()
> {
>  struct mallinfo mi;
>  mi = mallinfo();
>  printf("MemUsage: %d\n", mi.arena);
> }
> 
> int main(unsigned long long spe_id, unsigned long long
> program_data_ea, unsigned long long env)
> {
>  printMemUsage();
>  void * dyn_mem = memalign(16, 65535);
>  printMemUsage();
>  free(dyn_mem);
>  printMemUsage();
>  return 0;
> }
> =====================================
> compile with:
> gcc main.c
> =====================================
> run:
> #./a.out
> MemUsage: 0
> MemUsage: 200704
> MemUsage: 135168
> #



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10756

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


  reply	other threads:[~2009-10-11 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-11 14:57 [Bug libc/10756] New: " phil dot pratt dot szeliga at gmail dot com
2009-10-11 15:04 ` phil dot pratt dot szeliga at gmail dot com [this message]
2009-10-12  1:15 ` [Bug libc/10756] " a_llison_life at yahoo dot com
2009-10-12  6:58 ` pasky at suse dot cz
     [not found] <bug-10756-131@http.sourceware.org/bugzilla/>
2014-07-01  5:41 ` fweimer at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091011150442.27315.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).