From: Philippe Gerum <rpm@xenomai.org>
To: Roderik.Wildenburg@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] rt_queue_write error: "Cannot allocate memory "; bug or feature ?
Date: Mon, 19 Nov 2007 15:35:31 +0100 [thread overview]
Message-ID: <47419F33.7040203@domain.hid> (raw)
In-Reply-To: <5D63919D95F87E4D9D34FF7748CE2C2AE09111@domain.hid>
Roderik.Wildenburg@domain.hid wrote:
> When running the attached programm for a while I get an "Cannot allocate memory" error with the function rt_queue_write.
What is the exact size of the message rt_queue_write() fails to send, as
displayed by your trace?
> I can´t see any obvious mistake in my code, so I don´t have an simple explanation for this behavior but just a suspicion (see below). Could somebody be so kind to try to reproduce this problem, so I can determine whether this is a problem of my context or of xenomai.
> I use Xenomai 2.3.2 with an 2.4.25 kernel on PPC.
>
> Or, even better, could somebody explain to me the functionality of heap allocation of native queues.
Message buffers are simply obtained from a memory pool managed as a
nucleus heap. rt_queue_write() allocates a message block from the pool
to hold the emitted data, and pushes it to the pending message queue,
rt_queue_read() then pops the next available message from this queue,
copies the payload data to the user-space buffer, and frees the message
block.
I have the impression the problem of my program results from some kind
of heap fragmentation,
as I write very differnt buffersizes to a quite small queue (see code
line 59-62).
>
It's unlikely, since the consumer thread has absolute priority (50) over
the producer in your code (30); in such a case, the buffer pool should
only have a single busy message block at any given time.
You may want to display /proc/xenomai/registry/native/queues/qtest1q
periodically, while your test program is running, and check the usedmem
field. If it indeed decreases over time, then there is a memory leak
somewhere.
--
Philippe.
next prev parent reply other threads:[~2007-11-19 14:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 13:43 [Xenomai-help] rt_queue_write error: "Cannot allocate memory "; bug or feature ? Roderik.Wildenburg
2007-11-19 14:35 ` Philippe Gerum [this message]
2007-11-19 15:11 ` Roderik.Wildenburg
2007-11-19 18:06 ` Philippe Gerum
2007-11-20 8:51 ` Roderik.Wildenburg
2007-11-20 13:59 ` Philippe Gerum
2007-11-21 14:07 ` Roderik.Wildenburg
2007-11-23 17:08 ` Philippe Gerum
2007-11-28 9:21 ` Roderik.Wildenburg
2007-11-28 9:43 ` Philippe Gerum
2007-11-28 10:05 ` Roderik.Wildenburg
2007-11-28 10:22 ` Philippe Gerum
-- strict thread matches above, loose matches on Subject: below --
2007-11-28 13:03 Roderik.Wildenburg
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=47419F33.7040203@domain.hid \
--to=rpm@xenomai.org \
--cc=Roderik.Wildenburg@domain.hid \
--cc=xenomai@xenomai.org \
/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.