From: Philippe Gerum <rpm@xenomai.org>
To: Steve B <sbattazzo@gmail.com>
Cc: xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] XDDP socket, any memory allocation when sendto() is called?
Date: Sat, 14 May 2016 15:00:49 +0200 [thread overview]
Message-ID: <57372181.5010607@xenomai.org> (raw)
In-Reply-To: <CAEMXjGzCEdjwSKyTMbi3vq5inFsPQ7vqcuf-HojCKGDgPj5sTw@mail.gmail.com>
On 05/13/2016 09:42 PM, Steve B wrote:
>
>
> On Fri, May 13, 2016 at 11:45 AM, Philippe Gerum <rpm@xenomai.org
> <mailto:rpm@xenomai.org>> wrote:
>
>
> Maybe. You should have a look at the vmstat output for a while (e.g.
> vmstat -a 1).
>
> Cobalt gets all the core memory it needs from __vmalloc() since 3.0.2
> (was __get_free_pages() in earlier 3.x releases), then stacks its own
> allocation scheme on top of this (cobalt/kernel/heap.c). So the memory
> usage on the RT side appears as one shot allocations only for getting
> the initial memory underlying the real-time heaps.
>
> --
> Philippe.
>
>
> Thanks, this has been informative for me on a few more things to be
> looking at during development cycle, if a little off topic for this
> mailing list.
> I think I've actually found what's happening. I went ahead and wiped out
> all of the log files even while the process was still running, and found
> that the memory is freed up immediately! So the memory consumption is in
> the files I'm saving, even though they're supposed to go to the on board
> flash filesystem. I understand that they might be stored in RAM
> initially before getting synced over to flash, but kind of interesting
> that the upper bound on that is almost the entire RAM. There may be an
> OS setting somewhere that sets a bound, or an occasional "sync" system
> call might help free that memory up if I really need to for some reason.
>
> Now that I've ruled out the XDDP and found what's actually happening, it
> becomes more of a Linux question than a Xenomai thing but thanks for
> helping me narrow it down!
>
As Gilles pointed out, the fs cache is likely eating that memory. You
could try flushing it, before looking at the available free memory again:
# echo 1 > /proc/sys/vm/drop_caches
--
Philippe.
next prev parent reply other threads:[~2016-05-14 13:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 23:42 [Xenomai] XDDP socket, any memory allocation when sendto() is called? Steve B
2016-05-13 13:50 ` Philippe Gerum
2016-05-13 17:53 ` Steve B
2016-05-13 18:08 ` Philippe Gerum
2016-05-13 18:19 ` Steve B
2016-05-13 18:27 ` Steve B
2016-05-13 18:45 ` Philippe Gerum
2016-05-13 19:42 ` Steve B
2016-05-14 12:28 ` Gilles Chanteperdrix
2016-05-14 13:00 ` Philippe Gerum [this message]
2016-05-17 0:17 ` Steve B
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=57372181.5010607@xenomai.org \
--to=rpm@xenomai.org \
--cc=sbattazzo@gmail.com \
--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.