All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Yigal Goldberger <yigal_gold@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] pthread_create memory size
Date: Tue, 07 Jul 2009 16:11:16 +0200	[thread overview]
Message-ID: <4A535784.5000804@domain.hid> (raw)
In-Reply-To: <558095.42393.qm@domain.hid>

Yigal Goldberger wrote:
> Hi all,
> I'm using xenomai  on kernel 2.6.29 on a powerpc based board.
> I see that when I call : 
> cat proc/meminfo
> before pthread_create and after it there is a difference of 2MB in free memory , indicating that the thread is being allocated 2MB of ram (?) .
> 
> before :
> MemTotal:       256868 kB
> MemFree:        227624 kB
> 
> After :
> MemTotal:       256868 kB
> MemFree:        225632 kB
> 
> I am calling pthread_attr_setstacksize(&attr,8192)
> before calling pthread_create so it shouldn't be the stack size .
> Is this the expected memory consuption per thread ? 
> if not, how can I reduce this ?

That is explained in the TROUBLESHOOTING guide, use ulimit -s. In fact,
I suspect the behaviour depends on the version of the glibc you use. A
better indicator of your process memory map is /proc/pid/maps.

Note that a stacksize of 8K is a bit low, such simple functions as
printf will cause stack overflows with this stack size.

-- 
                                          Gilles



  reply	other threads:[~2009-07-07 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07 14:06 [Xenomai-help] pthread_create memory size Yigal Goldberger
2009-07-07 14:11 ` Gilles Chanteperdrix [this message]
2009-07-07 14:13   ` Gilles Chanteperdrix
     [not found] <206278.72023.qm@domain.hid>
2009-07-07 17:41 ` Gilles Chanteperdrix
     [not found] <852117.36446.qm@domain.hid>
2009-07-08  8:26 ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2009-07-08 10:52 Yigal Goldberger
2009-07-08 11:12 ` Gilles Chanteperdrix

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=4A535784.5000804@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=xenomai@xenomai.org \
    --cc=yigal_gold@domain.hid \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.